944,141 Members | Top Members by Rank

Ad:
  • PHP Discussion Thread
  • Unsolved
  • Views: 377
  • PHP RSS
Nov 3rd, 2009
0

Deleting rows

Expand Post »
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?
Similar Threads
Reputation Points: 10
Solved Threads: 0
Junior Poster in Training
futhonguy is offline Offline
69 posts
since Oct 2009
Nov 3rd, 2009
-1
Re: Deleting rows
futhonguy,
I already answered this question in the other thread you posted about an hour ago:
http://www.daniweb.com/forums/thread235823.html
Reputation Points: 40
Solved Threads: 31
Junior Poster
EvolutionFallen is offline Offline
198 posts
since Aug 2009
Nov 4th, 2009
-1
Re: Deleting rows
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; Nov 4th, 2009 at 1:53 am. Reason: Edit: Duplicate thread?
Reputation Points: 29
Solved Threads: 76
Practically a Master Poster
network18 is offline Offline
616 posts
since Sep 2009
Nov 4th, 2009
-2
Re: Deleting rows
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...
Reputation Points: 10
Solved Threads: 3
Newbie Poster
violarisgeorge is offline Offline
15 posts
since May 2009
Nov 5th, 2009
0
Re: Deleting rows
Thanks guys.
will give that a try.
Reputation Points: 10
Solved Threads: 0
Junior Poster in Training
futhonguy is offline Offline
69 posts
since Oct 2009

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in PHP Forum Timeline: PHP to display content in editable text area
Next Thread in PHP Forum Timeline: PHP Email Form with Validation





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC