RE: [PHP] mysql_num_rows always returns 1?

2002-06-18 Thread Niklas Lampén
Try $query = select count(*) as Lines from users where and then check the value of Lines. Or then do something like $query = select ID from users where and now your mysql_num_rows($result) should return right kinda value. Niklas -Original Message-

Re: [PHP] mysql_num_rows always returns 1?

2002-06-18 Thread Eugene Mah
At 13:00 18-06-02 +0100, Mark Colvin wrote: The function below works when I pass in a valid username and password and returns '1'. When I pass a username and password that is not in the database it still returns '1'. I have put some echo statements in for debugging and the value of $numresult is

RE: [PHP] mysql_num_rows always returns 1?

2002-06-18 Thread David Freeman
$query = select count(*) from users where You are asking for a count() in your query. This will always give you one row returned with a count. If you really want to do this you should probably have: $query = select count(*) as usercount from users where Then you can do your tests