maxudaskin Posted October 16, 2007 Share Posted October 16, 2007 Error: Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/.grable/vzoom/virtualzoom.net/comm/forum_posts.php on line 333 Code: <?php while($forum_array = mysql_fetch_array($forum_query)){ $forum_id = $forum_array['topicid']; $replies_sql = "SELECT * FROM forum_posts WHERE topicid = '{$forumid}"; $replies_query = mysql_query($replies_sql,$conn); $replies = mysql_num_rows($replies_query); // Line 333 /* ... Code cut out */ ?> Quote Link to comment https://forums.phpfreaks.com/topic/73530-solved-mysql_num_rows/ Share on other sites More sharing options...
BlueSkyIS Posted October 16, 2007 Share Posted October 16, 2007 add this after your mysql_query(): or die(mysql_error()); Quote Link to comment https://forums.phpfreaks.com/topic/73530-solved-mysql_num_rows/#findComment-370971 Share on other sites More sharing options...
maxudaskin Posted October 16, 2007 Author Share Posted October 16, 2007 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 ''1' at line 1 <!--#include file="../loginscript.php" --> // Line 1 Quote Link to comment https://forums.phpfreaks.com/topic/73530-solved-mysql_num_rows/#findComment-370977 Share on other sites More sharing options...
BlueSkyIS Posted October 16, 2007 Share Posted October 16, 2007 there is a missing single quote in your SQL. Quote Link to comment https://forums.phpfreaks.com/topic/73530-solved-mysql_num_rows/#findComment-370979 Share on other sites More sharing options...
maxudaskin Posted October 16, 2007 Author Share Posted October 16, 2007 That would do it... Thank you. Quote Link to comment https://forums.phpfreaks.com/topic/73530-solved-mysql_num_rows/#findComment-370984 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.