The question here is, which method do you find more efficient quick in the situation of needing to count the number of rows returned from a mysql_query. I was taught that mysql_num_rows() was a slow, inelegant, and overall bad method of doing this and that MySQL was just the opposite.
What are your opinions?
$query = mysql_query("SELECT * FROM `users`"); $count = mysql_num_rows($query); echo $count;
vs Example MySQL:
$query = mysql_fetch_assoc(mysql_query("SELECT COUNT(*) FROM `users`")); echo $query["COUNT(*)"];