Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Deleting by index number?

Status
Not open for further replies.

bam720

Technical User
Sep 29, 2005
289
US
I have a form which has alread processed a "SELECT * FROM Equip WHERE `ClientName` = 'CName'" So i already have a result set. I was curious if there is a way to delete from this result set certain indexes. Such as the first and third records in this set? I am using MySQL with php. Thanks.
 
You would have to go through the records one by one, identifying which ones meet your criteria for deletion, and either execute a "DELETE FROM equip WHERE fld=123" for each one, or assemble a delete query as you go, and execute the query at the end, something like "DELETE FROM equip WHERE fld IN (123,456,789)".
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top