Maybe this will help. I do all my counts this way. I know there is a better way, but this way works
$query="select COUNT(*) as total from mytable where this='that'";
$results=mysql_query($query);
if($myrow=mysql_fetch_array($results)) {
echo "Total = ".$myrow["total"]."";
}