Hey there, im not very great at php and im wondering how i could fix this error

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home2/blindst/public_html/forumbeta/vtopic.php on line 328
No replys to this topic.

This is line 328

$sql2=("SELECT * FROM `reply` WHERE tid = '$id' ORDER by id LIMIT $from, $div");

$num1=mysql ect ect is line 328 any help is much apreicated.

11 Years
Discussion Span
Last Post by PH03N1X

You're mysql query isnt a valid one, first off, at the end of querys you should get use to doing this:

mysql_query(blah) or die(mysql_error());

That will tell you if the query doesn't work.

Really, without seeing your table there isnt much that I can tell you to fix, just check all your names and do what I said above. Also, it doesn't hurt to echo $query2 to find out what it says inside that, if it's not a valid pointer your sql will fail. Try messing around with what I said a little and if it still doesn''t help, come back.

Oh also, at the top of your put this:

error_reporting ( E_ALL);

That will help in deciding on what the errors specifically are.


I got a different error when i took at $div and it said syntax error in the sql


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 '-30, 30' at line 1

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.