I have made a delete script with multiple delete. Everything runs great until the delete ID being fed hits 10 or more, then it splits it into 1 and 0 instead of 10. Here is the delete PHP:
PHP Code:
###### If Delete Was Hit ######
else if ($_POST['delete']) {
$links = mysql_query("SELECT * FROM `cms_nav` ORDER BY id ASC") or die ("Error Getting Links! \n <br /> \n" .mysql_error());
$chk = mysql_num_rows($links);
for ($i=0; $i<$chk; $i++) {
$del_id = $checkbox[$i];
$del = mysql_query("DELETE FROM `cms_nav` WHERE id = '$del_id'") or die ("Error Deleting Selected! \n<br />\n" .mysql_error());
echo('Del ID: '.$del_id.' ');
}
echo('<meta http-equiv="refresh" content="2;URL=nav.php" /> <div class="message">The selected links have been deleted</div>');
}
###### ################# ######
When I this code added to the script and the ID to be deleted is 10, it echos Del ID: 1 Del ID: 0
Code:
echo('Del ID: '.$del_id.' ');
Here is the HTML sending the information:
HTML Code:
<input type="checkbox" name="checkbox" value="<?php echo $l['id']; ?>" />
Anyone know why it is doing this?
Thanks in advance
Bookmarks