show total score on statistic site

This commit is contained in:
2022-06-08 12:52:39 +02:00
parent 42cd6956b9
commit 0962a70cd7
3 changed files with 41 additions and 1 deletions

View File

@@ -81,7 +81,18 @@ function get_teams($con) {
$stmt->execute();
$stmt->setFetchMode(PDO::FETCH_ASSOC);
return $stmt;
} catch(PDOExeption $e) {
} catch(PDOException $e) {
handle_pdo_exception($e);
}
}
function get_total_score($con) {
try {
$stmt = $con->prepare("SELECT M.name as Mannschaftsname, M.feuerwehr as Feuerwehr, SUM(P.punkte) as Gesamtpunkte FROM Punkte as P, Mannschaft as M WHERE P.m_id = M.m_id GROUP BY M.m_id ORDER BY Gesamtpunkte DESC");
$stmt->execute();
$stmt->setFetchMode(PDO::FETCH_ASSOC);
return $stmt;
} catch(PDOException $e) {
handle_pdo_exception($e);
}
}