deleting bulk
Posted: Mon Oct 31, 2005 10:07 am
just a quick question, on one page I would have a bunch of checkboxes like so:
and I would like to select a few of them and click a delete button which would go to a place like this:
which would work fine for deleteing one row but I would like it to delete a few more than that and wouldnt really want to make a huge page with a lot of 'if' statements or anything, im thinking a loop might work or something like that. What would you guys suggest on this one?
Code: Select all
<input type="checkbox" name="val" value="1"><br>
<input type="checkbox" name="val" value="2"><br>
<input type="checkbox" name="val" value="3"><br>
<input type="checkbox" name="val" value="4"><br>
<input type="checkbox" name="val" value="5"><br>
//continuesCode: Select all
<?PHP
$val = $_POST['val'];
mysql_query("DELETE FROM pm WHERE val=$val");
?>