using multiple checkboxes to delete from db
| From: | wesley grubbs:. | Date: | Sat, 30 Mar 2002 12:58:50 +0000 |
| Subject: | using multiple checkboxes to delete from db | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-18058@lists.php.net to get a copy of this message | ||
i've been playing half the day with trying to get php to delete rows when a
checkbox is checked.
i have a page that pulls all the data from db in a table. one row contains
checkboxes. i want it so that whereever a checkbox is checked and then
submit, all the selected rows will be deleted.
<table>
<?php
//get results from db
while($row = mysql_fetch_array ($result)) {
?>
<tr>
<td><input type="checkbox" name="delete" value="<?php
print($row[id]);
?>"></td>
</tr>
<?php
}
?>
</table>
what's the proper function i should write for this?
also, can i put the function on the same page without useing SWITCH?
i'm trying to minimize the number of files i have.
thanks in advance for any help.
wes
www.devedeset.com