Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / NewStats: 3,150,827 members, 7,810,177 topics. Date: Friday, 26 April 2024 at 10:33 PM |
Nairaland Forum / Science/Technology / Webmasters / How Do I Delete From Database (532 Views)
Please How Can I Delete .maintenance File From My Remote Host Directory? / How Can I Delete The Topic I Created On Nairaland / Please How Do I Delete A Pic I Posted Mistakenly? (2) (3) (4)
How Do I Delete From Database by Raylight2(m): 10:45am On Apr 25, 2015 |
please o How do I delete from database with php. I have two fields 1. Id and 2. news please help me with the script. I need this to complete my work. Thanks |
Re: How Do I Delete From Database by Adesege(m): 10:57am On Apr 25, 2015 |
Post the table schema here so i can have a look. To delete from a table, you must set a PRIMARY KEY to one of the columns in the table. Usually an 'id' column. Also state the DB driver you are using. Mysql, mysqli or PDO. Raylight2: |
Re: How Do I Delete From Database by dwebdesign(m): 11:35am On Apr 25, 2015 |
Follow these steps, //connect to the database first <?php $con= mysql_db_connect("local host", "db username", "db password" $delete= DELETE FROM table name WHERE row id, colunm id ; if (mysql_query($delete , $con) { echo num_row_affected() . "successfully deleted"; else echo " not successfull" .mysql_connect_error(); ?> Contact: Mobile: 08133884165 WhatsApp: 08133884165 BBM: 2BB63350 http://www.1st-websitedesign.com Am a website developer skilled in languages as: HTML/HTML5, CSS/CSS3, PHP, MYSQL, Javascript/Jquery,JqueryMobile,Bootstrap Ajax. phpquard CMS (Wordpress, Joomla, Opencart, Magento, Whmcs, Drupal and Pulse Cms, blogger ). |
Re: How Do I Delete From Database by Raylight2(m): 5:48pm On Apr 27, 2015 |
I got it... thanks to you all. |
(1) (Reply)
Webmasters Drop Your Site For Review / Help, My Blog Is Loadin Very Slow / Get Auto Blogging On Your Blog/site For Free And Make Money
(Go Up)
Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health religion celebs tv-movies music-radio literature webmasters programming techmarket Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10) Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 6 |