stekenno Posted June 18, 2012 Share Posted June 18, 2012 Hello I have browsed this site many times looking for answers and it's helped alot but I couldn't find an answer for this problem. I want messages to be displayed in the mail box to a certain amount say 25 and when a new mail is received the 26th one is then deleted. $mysql1 = mysql_query("SELECT * FROM `inbox` WHERE `to`='$username' AND `read` = '1' ORDER by id DESC LIMIT 25"); $num_rows =mysql_num_rows($mysql1); if ($num_rows == "0"){ echo "<center>No Messages</center>"; }else{ while($get = mysql_fetch_object($mysql1)){ mysql_query(DELETE * FROM `inbox` WHERE `to`='$username' AND `read` = '1' NOT IN (SELECT * FROM `inbox` WHERE `to`='$username' AND `read` = 1 ORDER by id DESC LIMIT 2)); THIS Part is the broken bit. $t++; $n++; echo " <table width=90% border=0 align=center cellspacing=0 class=messagetable> Quote Link to comment Share on other sites More sharing options...
Pikachu2000 Posted June 18, 2012 Share Posted June 18, 2012 What does echo mysql_error() show you? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.