Adding check boxes to delete mysql

ucanpijama

New Member
Can someone tell me what I am doing wrong....I have a checkbox at top when clicked it ticks all on list, got one checkbox for each line also when I click delete I want it to delete the selected rows.\[code\]/* Inbox Delete options */if($_POST['Delete']){ mysql_query("DELETE FROM `Messages` WHERE `id` = '{$fetchMessages['id']}' AND `sendto` = '{$fetchAccount['UserName']}'");echo "You DisLiked {$fetchUser['UserName']}!<br /><br />";}?> <tr> <td class="content1" wdith="5%"><input type='checkbox' class='checkbox' name='Checkbox[]' value='http://stackoverflow.com/questions/14570281/<?=$fetchMessages['id']?>' /></td> <td class="content1" width="20%"><a href="http://stackoverflow.com/questions/14570281/UserProfile.php?view=<?=$fetchMessages['sendby']?>"><?=$fetchMessages['sendby']?></a></td> <td class="content1" width="35%"><?=$fetchMessages['title']?></td> <td class="content1" width="25%" style="text-align: center;"><?=$fetchMessages['time']?></td> <td class="content1" width="15%" style="text-align: center;"><a href="http://stackoverflow.com/questions/14570281/MessagesView.php?view=<?=$fetchMessages['id']?>"><?=$fetchMessages['read']?></a></td> </tr> <?} ?> <tr> <td class="content1" colspan="5"><center><input type='submit' name='Delete' value='http://stackoverflow.com/questions/14570281/Delete Selected' /></center></tr>\[/code\]At the moment I have got it to delete but it deletes all not just the selected but select all doesn't work at all.Help please, thanks in advance. :)
 
Back
Top