show teams table and terminate db connection
This commit is contained in:
@@ -73,4 +73,15 @@ function get_stations($con) {
|
||||
} catch(PDOException $e) {
|
||||
handle_pdo_exceptio($e);
|
||||
}
|
||||
}
|
||||
|
||||
function get_teams($con) {
|
||||
try {
|
||||
$stmt = $con->prepare("SELECT name, feuerwehr FROM Mannschaft");
|
||||
$stmt->execute();
|
||||
$stmt->setFetchMode(PDO::FETCH_ASSOC);
|
||||
return $stmt;
|
||||
} catch(PDOExeption $e) {
|
||||
handle_pdo_exception($e);
|
||||
}
|
||||
}
|
||||
@@ -42,4 +42,14 @@ function load_stations_table($con) {
|
||||
echo "<td>" . $row['standort'] . "</td>";
|
||||
echo "</tr>";
|
||||
}
|
||||
}
|
||||
|
||||
function load_teams_table($con) {
|
||||
$stmt = get_teams($con);
|
||||
foreach($stmt->fetchAll() as $row) {
|
||||
echo "<tr>";
|
||||
echo "<td>" . $row['name'] . "</td>";
|
||||
echo "<td>" . $row['feuerwehr'] . "</td>";
|
||||
echo "</tr>";
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user