Quote:
Originally posted by john.eovie
I'll post the main issue here, so everyone can have a go.
Basically, I need a SQL query that will select the highest score each userid has, and output the records.
So:
1. There's only one record per userid value
2. And the score value that corresponds to the userid is the highest one.
|
This only needs a single query. Try this:
PHP Code:
$leaderboard_q = $DB_site->query("SELECT game,userid,comment,max(score) as maxscore
FROM arcade
WHERE game='tetris'
GROUP BY userid
ORDER BY maxscore DESC
LIMIT $yourlimit");
That should give you what you need.
I am making a new scoreboard right now that does just this. I'll post a link when it's done.