lets say you want to find out how many users you have that are registered..

for example, i have a table called users and a field called confirmed and i want to do a query of the number of users who have been confirmed

this is an example query i would use

PHPCODE:
$sql = "SELECT username FROM users WHERE confirmed='yes'";
$result = mysql_query($sql ,$db);
$confirmedusers= mysql_num_rows($result);


as you can see, the mysql_num_rows() functions does this trick well