Hi
I think I know what you mean by deleting multiple records at once by using checkboxes.
Actualy I'v done it in one of my websites.
in the form that user is able to check multiple records use this script
-
<?PHP
-
$maximum = 10; //10 is the number of results per page (could be any other number)
-
for ($i=1; $i <= $maximum; $i++) {
-
print "<input type=\"checkbox\" name=\"checkbox-$i\" value=\"$recordid[i]\" />";
-
}
-
?>
-
As you can see $recordid is an array containing your record ids. and name of you checkboxes are ("checkbox-"+recordid)
Then this is what happens when user submits the form
Selected checkboxes return the value of the record ids that should be deleted
Now all you have to do is to control checkboxes to see if they have been checked or not
Like this:
-
<?PHP
-
$maximum = 10; //10 is the number of results per page (could be any other number)
-
for ($i=1; $i <= $maximum; $i++) {
-
if ($_REQUEST["checkbox-$i"]) {
-
$query = "DELETE FROM yourtable WHERE id='$_REQUEST[\"checkbox-$i\"]'";
-
mysql_query($query);
-
}
-
}
-
?>
-
-
Note that there are other options to make your quey variable. Like adding all of them in one query and do it at once instead of deleting them one by one
Hope this helps you