From 57514b22ce00e38f6e03395c845ae0dbc45835bd Mon Sep 17 00:00:00 2001 From: Leander Date: Wed, 26 Apr 2017 10:05:52 +0200 Subject: [PATCH] added null opt 2 hs --- allhighscores.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/allhighscores.php b/allhighscores.php index c0ce8f2..c4e905d 100644 --- a/allhighscores.php +++ b/allhighscores.php @@ -15,7 +15,8 @@ $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, "name" ASC + $overview = $db->query('SELECT "name", COALESCE("highscore", -1) as "highscore" + FROM "Users" ORDER BY COALESCE("highscore", -1) DESC, "name" ASC LIMIT $1 OFFSET $2', array($limit, $offset))['data']; foreach($overview as $row) { $name = $row['name'];