add stations

This commit is contained in:
2022-06-09 16:47:35 +02:00
parent 7bf8b8c1bf
commit af4207f66e
5 changed files with 72 additions and 22 deletions

View File

@@ -154,4 +154,15 @@ function write_points($con, $s_id, $m_id, $points, $time) {
} catch(PDOException $e) {
handle_pdo_exception($e);
}
}
function write_station($con, $station_name, $station_pos) {
try {
$stmt = $con->prepare("INSERT INTO Station (name, standort) VALUES (?, ?)");
$stmt->bindParam(1, $station_name, PDO::PARAM_STR);
$stmt->bindParam(2, $station_pos, PDO::PARAM_STR);
$stmt->execute();
} catch(PDOException $e) {
handle_pdo_exceptio($e);
}
}