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 */ ?> 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()); 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 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. 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. Link to comment https://forums.phpfreaks.com/topic/73530-solved-mysql_num_rows/#findComment-370984 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.