deleting multiple records with check box selection
Posted: Sat Jun 27, 2009 10:51 am
Hey guys thanks for the help on my last posts. I have one other thing I am stuck on.
I make a email system and I have the selectall working to select all emails which check all the checkboxes now I need to either make a page with the code on it or java or something to when i click delete it will remove them.
I am so close the samples i have found just isnt working like i want. I know arrays are involved but just not getting it correct.
Here is my code if it will help
I make a email system and I have the selectall working to select all emails which check all the checkboxes now I need to either make a page with the code on it or java or something to when i click delete it will remove them.
I am so close the samples i have found just isnt working like i want. I know arrays are involved but just not getting it correct.
Here is my code if it will help
Code: Select all
<table width="90%" align="center">
<tr><td bgcolor="#33CCFF"><input type="checkbox" name="checkall2" onclick="checkUncheckAll(this);"/>
Select All | [b]<input name="delete" type="submit" value="Delete">[/b]</td>
</tr></table>
<table width="90%" align="center">
<tr>
<td width="17%">
<tr>
<td align="left"><input type="checkbox" name="checkall" onclick="checkUncheckAll(this);"/>Select All | </td>
<td></td>
<td width="23%" align="left">Email</td>
<td width="33%">Subject</td>
<td width="18%">Date Received</td><td width="9%"></td>
</tr>
[b]<?php
$r = mysql_query("SELECT * from blah where email='" . $_SESSION['sess_name'] . "' and status='1' OR email='admin@blah.com' and status='4' and id= '$usrid' ORDER BY SENT DESC ");
while($info = mysql_fetch_array($r, MYSQL_ASSOC)) {
echo'<tr><td><input type="checkbox" name="'.$info['id'].'" id="'. $info['id'].'" value="'.$info['id'].'">
</td><td><img src="../images/email.png"></td>
<td align="left"><a href="surf_mail.php?id=' . $info['id'] . '">admin@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>';
}
?>[/b]</table></form>