SELECT username, MAX(score) as biggest FROM `table` GROUP BY username
or in my php code:
$query = "SELECT username, MAX(score) as biggest FROM `table` GROUP BY username";
$result = mysql_query ($query,$connection);
while ($row = mysql_fetch_object($result)){
}
This works in phpmyadmin but in my phpcode it gives me this error:
Warning: mysql_fetch_object(): supplied argument is not a valid MySQL result resource in page.php on line 47
It does everything correctly it just displays that ugly error.