add teams to teams table and fix for login
This commit is contained in:
@@ -165,4 +165,25 @@ function write_station($con, $station_name, $station_pos) {
|
||||
} catch(PDOException $e) {
|
||||
handle_pdo_exceptio($e);
|
||||
}
|
||||
}
|
||||
|
||||
function get_fire_departments($con) {
|
||||
try {
|
||||
$stmt = $con->prepare("SELECT DISTINCT feuerwehr FROM Mannschaft");
|
||||
$stmt->execute();
|
||||
return $stmt;
|
||||
} catch(PDOException $e) {
|
||||
handle_pdo_exception($e);
|
||||
}
|
||||
}
|
||||
|
||||
function write_team($con, $team_name, $fire_department) {
|
||||
try {
|
||||
$stmt = $con->prepare("INSERT INTO Mannschaft (name, feuerwehr) VALUES (?, ?)");
|
||||
$stmt->bindParam(1, $team_name, PDO::PARAM_STR);
|
||||
$stmt->bindParam(2, $fire_department, PDO::PARAM_STR);
|
||||
$stmt->execute();
|
||||
} catch(PDOEXCEPTION $e) {
|
||||
handle_pdo_exception($e);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user