mysql_num_rows() returns the number of rows returned by a query.
Since you are using COUNT(), the query will always return one row, the result of COUNT, even if this is 0.
Example from shell
mysql> SELECT COUNT(*) FROM users;+----------+| COUNT(*) |+----------+| 21912 |+----------+mysql> SELECT COUNT(*) FROM users;+----------+| COUNT(*) |+----------+| 0 |+----------+