Re: php and checkboxes.

From: Date: Mon, 29 Sep 2003 11:36:04 +0000
Subject: Re: php and checkboxes.
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-164218@lists.php.net to get a copy of this message
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


« previous php.general (#164218) next »