contra10 Posted January 22, 2009 Share Posted January 22, 2009 i'm tryin to delete messages sent to an inbox... my code is <?php echo "<tr>"; echo"<td><Input type = 'Checkbox' Name ='checkbox' value ='$msgid'></td>"; echo "<td align='left' width='10%' height='50'>"; echo"<a href ='http://localhost/profile/index.php?user=$friendid' ><img src='http://localhost/image/imagereplace.php?id=$friendid'></a>"; echo "</td>"; if ($bgcc == $colorvalue){ echo"<td width= '90%' align='center' bgcolor='#DEDAD7'><a style='text-decoration:none' href ='http://localhost/inbox/message.php?msg=$msgid' >"; }else{ echo"<td width= '90%' align='center' bgcolor='black'><a style='text-decoration:none' href ='http://localhost/inbox/message.php?msg=$msgid' >"; } echo"<FONT FACE='ariel' SIZE='3' color='#0094f7'><b>$title<br><br></font></td></tr>"; echo "<tr><td></td><td></td>"; echo "<td align='right' bgcolor='#DEDAD7'><FONT FACE='ariel' SIZE='2' color='#0094f7'>Sent by <b>$sendingusername</b> on $date</font></a></td>"; echo "</tr>"; } ?> <input type="submit" name="delete" value="delete"> </table> </form> <?php if (isset($_POST['checkbox']) and ($_POST['delete'])) { $checkboxid = mysql_real_escape_string($_POST['checkbox']); mysql_query("DELETE FROM inbox WHERE iid='$checkboxid'"); } ?> Link to comment https://forums.phpfreaks.com/topic/142016-solved-delete-from-mysqla-checkboxed-item/ Share on other sites More sharing options...
The Little Guy Posted January 22, 2009 Share Posted January 22, 2009 did you spell id correct? In the following you have to i's is that right? "DELETE FROM inbox WHERE iid='$checkboxid'" Link to comment https://forums.phpfreaks.com/topic/142016-solved-delete-from-mysqla-checkboxed-item/#findComment-743626 Share on other sites More sharing options...
contra10 Posted January 22, 2009 Author Share Posted January 22, 2009 yep...its supposed to be iid...i jus tried it again it worked Link to comment https://forums.phpfreaks.com/topic/142016-solved-delete-from-mysqla-checkboxed-item/#findComment-743633 Share on other sites More sharing options...
contra10 Posted January 22, 2009 Author Share Posted January 22, 2009 when i click delete tho..how do i go back to the same page and show the inbox...cause i have to press the back button in internet explorer ...should i do header Link to comment https://forums.phpfreaks.com/topic/142016-solved-delete-from-mysqla-checkboxed-item/#findComment-743636 Share on other sites More sharing options...
The Little Guy Posted January 22, 2009 Share Posted January 22, 2009 So... Topic Solved? Link to comment https://forums.phpfreaks.com/topic/142016-solved-delete-from-mysqla-checkboxed-item/#findComment-743637 Share on other sites More sharing options...
contra10 Posted January 22, 2009 Author Share Posted January 22, 2009 yep Link to comment https://forums.phpfreaks.com/topic/142016-solved-delete-from-mysqla-checkboxed-item/#findComment-743646 Share on other sites More sharing options...
contra10 Posted January 22, 2009 Author Share Posted January 22, 2009 one last question from it...how can i delete it but still display the other messages? Link to comment https://forums.phpfreaks.com/topic/142016-solved-delete-from-mysqla-checkboxed-item/#findComment-743652 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.