
08-26-2002, 07:57 AM
|
|
|
Join Date: Jun 2002
Posts: 100
Благодарил(а): 0 раз(а)
Поблагодарили:
0 раз(а) в 0 сообщениях
|
|
Quote:
Originally posted by futureal
This can be done. Here's an example:
http://www.shadowsofnamek.com/forum/...game=tetris&s=
Or another, from a different game:
http://www.shadowsofnamek.com/forum/...me=breakout&s=
Only each user's best score is shown. To accomplish this, you need to alter the query used in tetris.php for the "leaderboard" action.
From the original tetris.php file, you will want to replace this:
PHP Code:
$leaderboard_q = $DB_site->query("SELECT * FROM arcade WHERE game='tetris' ORDER BY score DESC LIMIT 10");
with 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 10");
That should achieve the result you're looking for.
|
I think there might be some error to this. I tried it but the comments didnt go to where they were suppose to.
|