Question about mysql_num_rows

The query below works fine, however, I am not getting a number returned for $distinctUsers. Can anyone see what I’ve obviously overlooked?

Thanks!


$users = "SELECT distinct m.uID, u.firstName, u.email, count(*) as totalMatches FROM matches m left JOIN users u on m.uID = u.uID WHERE m.processed is null and date(dateScheduled) = curdate() GROUP by m.uID";

$distinctUsers = mysql_num_rows($users);

$usersResult = mysql_query($users) OR die; 

You need to put that line after $usersResult and instead of passing $users, you need to pass $usersResult.

$users = "SELECT distinct m.uID, u.firstName, u.email, count(*) as totalMatches FROM matches m left JOIN users u on m.uID = u.uID WHERE m.processed is null and date(dateScheduled) = curdate() GROUP by m.uID";

$usersResult = mysql_query($users) OR die;  

$distinctUsers = mysql_num_rows($usersResult);

Thank you!