Simple: foreach($_POST['del_checkboxes'] as $id) { $sql="delete from table where id='$id'"; }
Checkboxes are created using <input .... name="del_checkboxes" value="<?= $id ?>">
Angelo Zanetti wrote:
Hi all
I have a table that is populated from a database which gets the IDs of the records from a php array.Every row in the table has a checkbox next to the actual record, what I want to do is to allow the user to select the records they want to remove by clicking the checkbox(es) and then click a button to submit the form.
so how do I remove these records? do I:
-do I do an array_diff and then just select the records that are remaining?
this to me seems the most logical.
tia
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php