using mysql with php. I have a very large table and I want to get the number of a specific amount from one of the fields. I can use two ways of getting this info, but would like to know which is the fastest and most efficient way. One way uses count() the other method uses num_rows. Thanks in advance.
$sql=mysql_query("select count(sentto) from mail where sentto ='$username' ");
$row = mysql_fetch_array($sql);
$username_check = $row['count(sentto)'];
echo "$username_check";
OR
$sql_sentto_check=mysql_query("select sentto from mail where sentto ='$username' ");
$username_check=mysql_num_rows($sql_sentto_check);
echo "$username_check";