seany123 Posted May 24, 2011 Share Posted May 24, 2011 can someone tell me why this isn't working? $query2 = mysql_query("SELECT * user_links WHERE url='$user_url'"); $num_rows = mysql_num_rows($query2); echo $num_rows; i just get this error: Warning: mysql_num_rows() expects parameter 1 to be resource, boolean given on line 31 Quote Link to comment https://forums.phpfreaks.com/topic/237359-how-to-use-mysql_num_rows/ Share on other sites More sharing options...
Maq Posted May 24, 2011 Share Posted May 24, 2011 You're missing FROM in your query. Quote Link to comment https://forums.phpfreaks.com/topic/237359-how-to-use-mysql_num_rows/#findComment-1219699 Share on other sites More sharing options...
seany123 Posted May 24, 2011 Author Share Posted May 24, 2011 damn that shows i need sleep. thankyou. Quote Link to comment https://forums.phpfreaks.com/topic/237359-how-to-use-mysql_num_rows/#findComment-1219700 Share on other sites More sharing options...
Maq Posted May 24, 2011 Share Posted May 24, 2011 Also, check out this blog entry for ways to help detect and handle exceptions and errors: http://www.phpfreaks.com/blog/or-die-must-die Quote Link to comment https://forums.phpfreaks.com/topic/237359-how-to-use-mysql_num_rows/#findComment-1219703 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.