From 5a50135ae913801edb4176dcf073b2fa0845f91b Mon Sep 17 00:00:00 2001 From: Leander Date: Tue, 25 Apr 2017 13:33:58 +0200 Subject: [PATCH] highscores sorted by name secondarily --- allhighscores.php | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/allhighscores.php b/allhighscores.php index d9979ca..b33ed79 100644 --- a/allhighscores.php +++ b/allhighscores.php @@ -15,7 +15,7 @@ $offset = isset($_GET['offset']) ? $_GET['offset'] : 0; $db = new Database(); if($cid == -1) { - $overview = $db->query('SELECT "name", "highscore" FROM "Users" ORDER BY "highscore" DESC + $overview = $db->query('SELECT "name", "highscore" FROM "Users" ORDER BY "highscore" DESC, "name" ASC LIMIT $1 OFFSET $2', array($limit, $offset))['data']; foreach($overview as $row) { $name = $row['name']; @@ -24,11 +24,6 @@ if($cid == -1) { $data[] = array('place' => $place, 'name' => $name, 'score' => $score); } } else { - /*$overview = $db->query('SELECT u."name", COALESCE(h."score", -1) AS "score" - FROM "Users" u RIGHT OUTER JOIN "Highscores" h ON u."ID" = h."Users_ID" - WHERE h."Categories_ID" = $1 - ORDER BY COALESCE(h."score", -1) DESC - LIMIT $2 OFFSET $3', array($cid, $limit, $offset))['data'];*/ $overview = $db->query('SELECT u."name", COALESCE(h."score", -1) AS "c_score" FROM "Users" u LEFT OUTER JOIN (SELECT "Users_ID", "score"