violinrocker Posted April 17, 2010 Share Posted April 17, 2010 i have this code and it doesnt seem to work.... when i remove "WHERE" it works $query = mysql_query('SELECT * FROM `friend_requests` WHERE `username` = `$session->username`'); echo "[<a href=\"newfriends.php\">Friend Requests(<font color='red' face='Arial'>".mysql_num_rows($query)."</font>)</a>]" Link to comment https://forums.phpfreaks.com/topic/198851-mysql_num_rows-and-where/ Share on other sites More sharing options...
Sergey Popov Posted April 17, 2010 Share Posted April 17, 2010 Try to do this: $query = mysql_query("SELECT * FROM friend_requests WHERE username = '".addslashes($session->username)."'"); Link to comment https://forums.phpfreaks.com/topic/198851-mysql_num_rows-and-where/#findComment-1043759 Share on other sites More sharing options...
violinrocker Posted April 17, 2010 Author Share Posted April 17, 2010 whew.. thanks a lot... it works now... been fixing it for hours haha thanks again Link to comment https://forums.phpfreaks.com/topic/198851-mysql_num_rows-and-where/#findComment-1043761 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.