Page 1 of 1

Mysql_num_rows

PostPosted: 04. September 2004 00:18
by Dreepa
I installed XAMPP and so far it rocks.
Winxp
I am trying to get the query result out of the database to display:

I used the following code:
$query = "SELECT *
FROM tester";
$result = mysql_query($query);
$number = mysql_num_rows($result);

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in C:\apachefriends\xampp\htdocs\xampp\va.php on line 17


I searched on google and found nothing.
Any ideas what is going wrong?
And libs I have to set?

PostPosted: 04. September 2004 00:25
by Wiedmann
Where is mysql_connect() and mysql_select_db() in your code? Is an error handling present with these two functions?