changed the total score to a station ranking on the homepage
This commit is contained in:
@@ -96,6 +96,17 @@ function get_total_score($con) {
|
||||
}
|
||||
}
|
||||
|
||||
function get_station_ranking($con) {
|
||||
try {
|
||||
$stmt = $con->prepare("SELECT S.name as Stationsname, SUM(P.punkte) as Gesamtpunkte FROM Punkte as P, Station as S WHERE P.s_id = S.s_id AND S.gewertet = \"1\" GROUP BY S.s_id ORDER BY Gesamtpunkte DESC");
|
||||
$stmt->execute();
|
||||
$stmt->setFetchMode(PDO::FETCH_ASSOC);
|
||||
return $stmt;
|
||||
} catch(PDOException $e) {
|
||||
handle_pdo_exception($e);
|
||||
}
|
||||
}
|
||||
|
||||
function get_station_name($con, $s_id) {
|
||||
try {
|
||||
$stmt = $con->prepare("SELECT name FROM Station WHERE s_id= :s_id");
|
||||
|
||||
Reference in New Issue
Block a user