gaogier Posted December 17, 2012 Share Posted December 17, 2012 Why do I get the following error? and How to fix? Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in/home/gaogier/public_html/pages/monsters.php on line 217 Here is my code http://pastebin.com/vrEamahn If i add the or die part, I get this message. You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 What do I do? Quote Link to comment https://forums.phpfreaks.com/topic/272117-a-mysql_num_rows-error/ Share on other sites More sharing options...
Pikachu2000 Posted December 17, 2012 Share Posted December 17, 2012 The query is failing. Along with the error, echo your query string and see what's wrong with it. Quote Link to comment https://forums.phpfreaks.com/topic/272117-a-mysql_num_rows-error/#findComment-1399970 Share on other sites More sharing options...
Muddy_Funster Posted December 18, 2012 Share Posted December 18, 2012 Also, why do you run 2 queries on the same table? and why do you run one of them twice? and the use of $result then $result1 is bad naming practice. Quote Link to comment https://forums.phpfreaks.com/topic/272117-a-mysql_num_rows-error/#findComment-1400029 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.