Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource

Reply

Join Date: Jan 2006
Posts: 3
Reputation: PH03N1X is an unknown quantity at this point 
Solved Threads: 0
PH03N1X PH03N1X is offline Offline
Newbie Poster

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource

 
0
  #1
Jan 13th, 2006
Hey there, im not very great at php and im wondering how i could fix this error

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


This is line 328

  1. $sql2=("SELECT * FROM `reply` WHERE tid = '$id' ORDER by id LIMIT $from, $div");
  2. $query2=mysql_query($sql2);
  3. $num1=mysql_num_rows($query2);

$num1=mysql ect ect is line 328 any help is much apreicated.
Reply With Quote Quick reply to this message  
Join Date: Jan 2006
Posts: 15
Reputation: Virii is an unknown quantity at this point 
Solved Threads: 0
Virii Virii is offline Offline
Newbie Poster

Re: Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource

 
0
  #2
Jan 13th, 2006
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.
Reply With Quote Quick reply to this message  
Join Date: Jan 2006
Posts: 3
Reputation: PH03N1X is an unknown quantity at this point 
Solved Threads: 0
PH03N1X PH03N1X is offline Offline
Newbie Poster

Re: Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource

 
0
  #3
Jan 13th, 2006
I got a different error when i took at $div and it said syntax error in the sql
Reply With Quote Quick reply to this message  
Join Date: Jan 2006
Posts: 15
Reputation: Virii is an unknown quantity at this point 
Solved Threads: 0
Virii Virii is offline Offline
Newbie Poster

Re: Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource

 
0
  #4
Jan 13th, 2006
What's the error say specifically?
Reply With Quote Quick reply to this message  
Join Date: Jan 2006
Posts: 3
Reputation: PH03N1X is an unknown quantity at this point 
Solved Threads: 0
PH03N1X PH03N1X is offline Offline
Newbie Poster

Re: Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource

 
0
  #5
Jan 15th, 2006
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
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC