Hello -
I'm new to PHP/MySQL, so please forgive the naivete of this question...
Basically I'm trying to delete multiple entries from my db when the items are checked off and submitted through a form.
$id is a numerical value, primary key of entry
form contains:
<input type=checkbox name=deleteitem value=$id>
and I'm using this to do it:
if ($action == "Delete Checked Items") {
if (count($deleteitem[items])) {
while ($id = $deleteitem[items]) {
$query = "DELETE FROM articles WHERE ID=$id";
if (!mysql_query($query)) {
echo("Can't delete the entries");
}
}
}
}
This results in a neverending loop, so clearly my problem is that I'm not passing in the values correctly.
Can someone please provide an explanation of what I'm doing wrong with a correction? Thank you very much.
shaBANG