Page 1 of 1

Help: Error: Warning: mysql_numrows():

Posted: Fri Apr 18, 2008 2:40 am
by ashebrian
Hi, I have an sql login system that allows members to buy on line. BUT i have one problem with the following error being displayed:

Code: Select all

Warning: mysql_numrows(): supplied argument is not a valid MySQL result resource in
I have a system that checks for active users online my site. As i'm testing it and nobody's online would this be de reason for this error to be popping up? Is there a solution to correct this? Can i hide the errors?

Re: Help: Error: Warning: mysql_numrows():

Posted: Fri Apr 18, 2008 3:07 am
by aceconcepts
Can you post the rest of your code?

There is something wrong with your query.

Re: Help: Error: Warning: mysql_numrows():

Posted: Fri Apr 18, 2008 5:45 am
by markusn00b
To use mysql_numrows() (deprecated: use mysql_num_rows()) you need to follow this format:

(we'll use mysql_num_rows())

Code: Select all

 
$_Query = "SELECT * FROM `tbl_name`";
$_Query = mysql_query($_Query);
$_Query = mysql_num_rows($_Query);
echo $_Query;