Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource in C:\htdocs\home\forums\viewforum.php on line 6

the other day a customer reported a problem with their website, he was doing some changes and could not find out what he did to cause this error.

in case you are also having this problem, today i will show you what's going on and how to fix it.


on line six of his viewforum.php file is said:

CODE:
$sql = "select count(topic_id) from phpbb_topics forum_id='".$_GET[f]."'";


looking at the code, you can clearly see that he forgot to put the WHERE in the $sql declaration. so to fix it, it should look like this:


CODE:
$sql = "select count(topic_id) from phpbb_topics  where forum_id='".$_GET[f]."'";


so basically if you are getting this erros it means that way you are declaring your sql fetch has an incorrect format, you probably forgot to add something, mispelled a word or a variable or have something a table or field in the database that doesn't exist.