[quote author=Unholy Prayer link=topic=116788.msg476025#msg476025 date=1164849356] Ok, this is my code to get the number of threads in the forum: [code] $count_sql = mysql_query('SELECT * FROM threads WHERE $fid = fid'); $threads = mysql_num_rows($count_sql);[/code] This is the error message that i get: [quote]Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/mtechdev/public_html/bbultimate/index.php on line 41[/quote] Can someone tell me what is wrong with my code? [/quote] Had the same problem yesterday. Try this $count_sql = mysql_query("SELECT * FROM threads WHERE fid = '$fid'") or die(mysql_error()); Change single ' to double ' and the put single ' around $fid like this '$fid' should work than