Try this:
PHP Code:
// <!-- TOP ARCADE GAMES -->
$mostactive = $DB_site->query_first("
SELECT COUNT(*) as total, gamesessions.gamename, games.title, games.gameid, MAX(gamesessions.score) as score, user.username, user.userid
FROM ".TABLE_PREFIX."gamesessions AS gamesessions
INNER JOIN " . TABLE_PREFIX . "games AS games ON(gamesessions.gamename = games.shortname)
INNER JOIN " . TABLE_PREFIX . "user AS user ON(games.highscorerid = user.userid)
WHERE gamesessions.valid=1
GROUP BY gamesessions.gamename
ORDER BY total
DESC LIMIT 0,5
");