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'];