function getHighscore() { if (isset($_GET["graph_id"])) { $graphId = $_GET["graph_id"]; if ($graphId < 1 || $graphId > 9) { echo "invalid graph ID!"; return; } $database = new Database(); $stmt = $database->getTop10Score($graphId); echo json_encode($stmt); } else { echo "Wrong parameters for get highscore!"; return; } }