I have read all the threads regarding multiple deletion using checkboxes.
And none of them seem to work properly. So hopefully someone has the right idea or knowledge.
Here is an example of my checkboxes:
<input type=checkbox name="del[]" value="1">
<input type=checkbox name="del[]" value="2">
<input type=checkbox name="del[]" value="3">
Here is an example of the PHP:
for ($i=0;$i < count($del); $i++)
{
$sql_id = $sql_id ."listID=$del[$i]" . " OR ";
}
$sql_id = substr($sql_id, 0, -3);
$result = mysql_query ("DELETE FROM list WHERE $sql_id") or die("Couldn't execute SQL query");
Now the onlyway this works is if you select EVERY checkbox. I could nto select the first and last.. it would not do anything.
Now also note that the values will not always be in order and it could be something like: 1, 7, 19
Any ideas?