Efrem Posted July 29, 2008 Share Posted July 29, 2008 function getNewMailAmt($uid) { global $database; $q = "SELECT * FROM privmsgs WHERE user_to='$uid' AND read='0'"; $r = mysql_query($q, $database->connection); return mysql_numrows($r); } Mmmk for the query i can do just $q = "SELECT * FROM privmsgs WHERE user_to='$uid'"; And it will work just fine, but when I add the AND, which i really need, it wont work. Any ideas? Also.. There are 3 rows in the DB that this should correspond with. Quote Link to comment Share on other sites More sharing options...
PFMaBiSmAd Posted July 29, 2008 Share Posted July 29, 2008 read is a reserved word. Either rename your column to something else or encolose it in back-ticks. `read` Quote Link to comment Share on other sites More sharing options...
Efrem Posted July 29, 2008 Author Share Posted July 29, 2008 Oh right right, i forgot about that, i had changed it before in the db but forgot about the query. Thanks! - Efrem 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.