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. Link to comment https://forums.phpfreaks.com/topic/117233-solved-function-not-working/ 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` Link to comment https://forums.phpfreaks.com/topic/117233-solved-function-not-working/#findComment-603050 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 Link to comment https://forums.phpfreaks.com/topic/117233-solved-function-not-working/#findComment-603092 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.