Hot to delete

Reply

Join Date: Feb 2008
Posts: 2
Reputation: bihartourism is an unknown quantity at this point 
Solved Threads: 0
bihartourism bihartourism is offline Offline
Newbie Poster

Hot to delete

 
0
  #1
Feb 23rd, 2008
Dear members how i can delete a record from a table in php?Give me the code plz...
Last edited by bihartourism; Feb 23rd, 2008 at 3:44 am.
Reply With Quote Quick reply to this message  
Join Date: Apr 2007
Posts: 18
Reputation: apsivam is an unknown quantity at this point 
Solved Threads: 4
apsivam's Avatar
apsivam apsivam is offline Offline
Newbie Poster

Re: Hot to delete

 
0
  #2
Feb 23rd, 2008
there is nothing special or specific to PHP,
use your normal SQL statement with PHP for example with MySQL
  1. mysql_query("DELETE FROM my_table WHERE id = 1");
Last edited by apsivam; Feb 23rd, 2008 at 4:01 am.
Cheers,
Sivanandhan, P. (a.k.a. apsivam)
www.apsivam.in
Reply With Quote Quick reply to this message  
Join Date: Oct 2005
Posts: 36
Reputation: tirivamwe is an unknown quantity at this point 
Solved Threads: 2
tirivamwe's Avatar
tirivamwe tirivamwe is offline Offline
Light Poster

Re: Hot to delete

 
0
  #3
Feb 23rd, 2008
try modify this code to suit what you want

  1.  
  2. $name= "record to delete"
  3.  
  4.  
  5. $sql = "DELETE FROM Users WHERE Name= '$name'"or die ("ERROR: Cannot not find user!");
  6.  
  7.  
  8. $result = mysql_query($sql) or die ("Error in query: $sql. ".mysql_error());
If you find this useful you can add to my reputation
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the PHP Forum


Views: 507 | Replies: 2
Thread Tools Search this Thread



Tag cloud for PHP
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC