Deleting rows

Reply

Join Date: Oct 2009
Posts: 20
Reputation: futhonguy is an unknown quantity at this point 
Solved Threads: 0
futhonguy futhonguy is offline Offline
Newbie Poster

Deleting rows

 
0
  #1
24 Days Ago
Hi
What i want to do is using php code to write to delete the entire row in the db. each row has its own id, field and content. instead of deleting the row with the id, can i do by the field name? how would i do this?
Reply With Quote Quick reply to this message  
Join Date: Aug 2009
Posts: 47
Reputation: EvolutionFallen is an unknown quantity at this point 
Solved Threads: 8
EvolutionFallen EvolutionFallen is offline Offline
Light Poster
 
-1
  #2
24 Days Ago
futhonguy,
I already answered this question in the other thread you posted about an hour ago:
http://www.daniweb.com/forums/thread235823.html
Reply With Quote Quick reply to this message  
Join Date: Sep 2009
Posts: 524
Reputation: network18 is an unknown quantity at this point 
Solved Threads: 61
network18 network18 is offline Offline
Posting Pro
 
-1
  #3
24 Days Ago
yes you can always do that provided that the field name has unique constraint on it.Otherwise you will end up deleting more than one row with the same field name but different ids.
Is this a duplicate thread you created. If in case, you forgot the one, after you created it, you can always see the threads started by you in the profile or else browse the threads subscribed by you; both options accessible from the control panel one of the menu from the row of top header menus
Last edited by network18; 24 Days Ago at 1:53 am. Reason: Edit: Duplicate thread?
"The discipline of writing something down is the first step towards making it happen."

follow me on twitter
Reply With Quote Quick reply to this message  
Join Date: May 2009
Posts: 15
Reputation: violarisgeorge is an unknown quantity at this point 
Solved Threads: 3
violarisgeorge's Avatar
violarisgeorge violarisgeorge is offline Offline
Newbie Poster
 
-2
  #4
23 Days Ago
This is simple, just instead of WHEREing the id in your query, you should WHERE the field. BUT take care with this, if you have two or more rows in which the field have the same name, then I'm afraid you'll be deleting all of these rows...
I take your reality and substitute my own
violarisgeorge.com
Reply With Quote Quick reply to this message  
Join Date: Oct 2009
Posts: 20
Reputation: futhonguy is an unknown quantity at this point 
Solved Threads: 0
futhonguy futhonguy is offline Offline
Newbie Poster
 
0
  #5
23 Days Ago
Thanks guys.
will give that a try.
Reply With Quote Quick reply to this message  
Reply

Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC