From 2d9df1ec29aeaeb6194381aa2fd39f4f37bc2fef Mon Sep 17 00:00:00 2001 From: Leander Date: Fri, 21 Apr 2017 10:15:17 +0200 Subject: [PATCH] T201704211015 --- allhighscores.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/allhighscores.php b/allhighscores.php index 859dba2..4d91d3d 100644 --- a/allhighscores.php +++ b/allhighscores.php @@ -29,11 +29,12 @@ if($cid == -1) { 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", h."score" - FROM "Users" u JOIN "Highscores" h ON u."ID" = h."Users_ID" - WHERE h."Categories_ID" = $1 - ORDER BY h."score" DESC - LIMIT $2 OFFSET $3', array($cid, $limit, $offset))['data']; + $overview = $db->query('SELECT u."name", h.score + FROM "Users" u LEFT OUTER JOIN + (SELECT "Users_ID", "score" + FROM "Highscores" + WHERE "Categories_ID" = $1) h ON u."ID" = h.Users_ID + ', array($cid))['data']; print_r($overview); foreach($overview as $row) { $name = $row['name'];