in reply to How to use checkbox to delete mutiple rows from database
Deleting a row by ID is easy:
DELETE FROM users WHERE id=?
As for more than one row, databases start to digress. Some give you the option to use IN(1,2,3)... but personally, I'd just delete them one by one in a loop. It's not like that would take such a long time: typically a small query will execute in a few milliseconds.
As you didn't say what kind of interface you're using, I can't go into much more details. In a HTML form you typically use the same name for every checkbox, and the id as the value. Then, for every checked checkbox, you'll get a parameter checkboxname=rowid. It's easy to loop through those.
|
|---|