Help: Error: Warning: mysql_numrows():

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
ashebrian
Forum Contributor
Posts: 103
Joined: Sat Feb 02, 2008 8:01 pm

Help: Error: Warning: mysql_numrows():

Post 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?
User avatar
aceconcepts
DevNet Resident
Posts: 1424
Joined: Mon Feb 06, 2006 11:26 am
Location: London

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

Post by aceconcepts »

Can you post the rest of your code?

There is something wrong with your query.
User avatar
markusn00b
Forum Contributor
Posts: 298
Joined: Sat Oct 20, 2007 2:16 pm
Location: York, England

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

Post 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;
 
Post Reply