That was a lot of responses fast. I'm gonna use the mysql_result approach over two lines. As far as the server is concerned, it won't take anymore time to do
$result = mysql_query("SELECT COUNT(*) tablename");
$row_count = mysql_result($result, 0);
than
$num_rows = mysql_result(mysql_query("COUNT(*) `cnt` FROM `table_name`"), 0, 'cnt');
Using two lines is just neater code 🙂 Oh and using a fieldname instead of * would also save some resource.