blob: d6f2717452d1573bbd8f76d9cea9a8bc6da1aebb (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
<?php
require_once __DIR__ . '/../db.php';
require_once __DIR__ . '/../session.php';
$db = get_db();
$id = $_REQUEST["id"];
$termin = $_REQUEST["termin"];
$uhrzeit = $_REQUEST["uhrzeit"];
$beschreibung = $_REQUEST["beschreibung"];
$anfahrt = $_REQUEST["anfahrt"];
try {
$stmt = $db->prepare("UPDATE konzert set termin=:termin, uhrzeit=:uhrzeit, beschreibung=:beschreibung, anfahrt=:anfahrt WHERE id=:id;");
$stmt->bindValue(":id", $id);
$stmt->bindValue(":termin", $termin);
$stmt->bindValue(":uhrzeit", $uhrzeit);
$stmt->bindValue(":beschreibung", $beschreibung);
$stmt->bindValue(":anfahrt", $anfahrt);
$stmt->execute();
} catch ( Exception $e ) {
$_SESSION["error"] = $e->getMessage();
error_log($e->getMessage());
}
if ( empty($_SESSION) || is_null($_SESSON["error"]) ) {
$_SESSION["success"] = "Erfolgreich aktualisiert!";
}
header($_SERVER["SERVER_PROTOCOL"] . " 302 Redirect");
header("Location: /");
|