Deleting multiple records with check box selection
I am trying to allow a delete button to remove and delete from the db records that have the check boxed checked. I have tried alot of different ways and no luck. Here is my code
The select all works fine no need to touch that but once i choose what i want deleted via checking the boxes and pressing delete nothing works when trying to delete them. If anyone can help thanks
<form action="mailbox.php" method="post">
<table width="90%" align="center">
<tr><td bgcolor="#33CCFF"><input type="checkbox" name="checkall2" onclick="checkUncheckAll(this);"/>
Select All | <input name="delete" type="submit" value="Delete"></td>
</tr></table>
<table width="90%" align="center">
<tr>
<td width="5%">
<tr>
<td align="left"> </td>
<td width="1%"></td>
<td width="28%" align="left">Email</td>
<td width="29%">Subject</td>
<td width="31%">Date Received</td>
<td width="6%"></td>
</tr>
<?php
$r = mysql_query("SELECT * from support where email='" . $_SESSION['sess_name'] . "' and status='1' OR email='blah@blah.com'and status='4' and id= '$usrid' ORDER BY SENT DESC ");
while($info = mysql_fetch_array($r, MYSQL_ASSOC)) {
{
echo'<tr><td><input name="checkbox[]" type="checkbox" value="'. $info['id'].'">
</td><td><img src="../images/email.png"></td>
<td align="left"><a href="surf_mail.php?id=' . $info['id'] . '">blah@blah.com</a></td>
<td align="left">'.$info['subject'].'</td>
<td>'.date("n-d-y",strtotime($info['sent'])).'</td><td><a href="mailbox.php?id=' . $info['id'] . '" onclick="javascript:return(confirm_delete('.$info['id'].'))">Delete</a></td>
</tr>';
}
}
?>
</table></form>
|