From cb83b27869346e2473e63d37207a892078acdd50 Mon Sep 17 00:00:00 2001 From: Leander Date: Mon, 10 Apr 2017 13:42:50 +0200 Subject: [PATCH] T201704101316 --- allhighscores.php | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 allhighscores.php diff --git a/allhighscores.php b/allhighscores.php new file mode 100644 index 0000000..507c168 --- /dev/null +++ b/allhighscores.php @@ -0,0 +1,25 @@ +query('SELECT "name", "highscore" FROM "Users" LIMIT $1 OFFSET $2', array($limit, $offset))['data']; +foreach($overview as $row) { + $name = $row['name']; + $score = $row['highscore']; + $place = $db->query('SELECT COUNT(*) FROM "Users" WHERE "highscore" > $1', array($score))['data'][0]['count']; + $data[] = array('place' => $place, 'name' => $name, 'score' => $score); +} + +$response = Database::create_response($data, $error); +print_r($response); \ No newline at end of file