I'm trying to count the number of unique rows in the query below. The mysql table is not using UNIQUE so it will need to be done with PHP. I figured out how to count the total rows using mysql_num_rows, but not how to omit any duplicate rows in $numbers. Yes I know this Query is deprecated.
$result = mysql_query("SELECT number FROM log WHERE username = '$foobar'")
or die(mysql_error());
$numbers = mysql_num_rows($result);
if(!isset($numbers)) {
$numbers = '0';
}