because the mysql manual says this:
COUNT(*) is optimized to return very quickly if the SELECT retrieves from one table, no other columns are retrieved, and there is no WHERE clause.
if i were have query with a WHERE clause, would it be faster/better to do this:
$q = "SELECT COUNT(*) FROM $source WHERE add_by_who = '$req_user'";
$result = mysql_query($q, $this->connection);
$row = mysql_fetch_row($result);
$num = $row[0];
OR this:
$q = "SELECT id FROM $source WHERE add_by_who = '$req_user'";
$result = mysql_query($q, $this->connection);
$num = mysql_num_rows($result);
(id is indexed)
any insights would be nice. thanks