From 73d0176758d7845f8bcf7533193181d2993ab1fa Mon Sep 17 00:00:00 2001 From: Findus23 Date: Fri, 27 Dec 2013 10:42:55 +0100 Subject: [PATCH] =?UTF-8?q?Orte=20sind=20=C3=A4nderbar=20+=20kleinere=20?= =?UTF-8?q?=C3=84nderungen?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ort_aendern.php | 64 +++++++++++++++++++++++++++++++++++++++ orte.php | 2 +- veranstaltung_aendern.php | 7 ++--- veranstaltungen.php | 2 +- 4 files changed, 69 insertions(+), 6 deletions(-) create mode 100644 ort_aendern.php diff --git a/ort_aendern.php b/ort_aendern.php new file mode 100644 index 0000000..89c92ac --- /dev/null +++ b/ort_aendern.php @@ -0,0 +1,64 @@ + + + + + + Ort ändern + + + + + +prepare("SELECT ort_name, stadt, plz, strasse, hausnummer FROM orte WHERE ort_id=?")) { + $stmt->bind_param("i", $id); + $stmt->execute(); + $stmt->bind_result($name, $stadt, $plz, $strasse, $hausnummer); //Daten auslesen und in Variablen speichern + $stmt->fetch(); + $stmt->close(); + } +?> +

Ort ändern

+
+

Name:

+

PLZ: Stadt:

+

Straße: Hausnummer:

+ +

+ + +
+ +close(); +} else { + $name = $_POST["name"]; + $stadt = $_POST["stadt"]; + $plz = $_POST["plz"]; + $strasse = $_POST["strasse"]; + $hausnummer = $_POST["hausnummer"]; + $id = $_POST["id"]; + if ($stmt = $mysqli->prepare("UPDATE orte set ort_name=?,stadt=?, plz=?, strasse=?, hausnummer=? WHERE ort_id=?")) { + $stmt->bind_param("sssssi", $name, $stadt, $plz, $strasse, $hausnummer, $id); + $stmt->execute(); + $stmt->close(); + $mysqli->close(); + header("Location: http://localhost/mysql/veranstaltung/orte.php"); + + } else { + echo "Wir haben ein Problem: " . $mysqli->error; + } + +} + +?> + + + \ No newline at end of file diff --git a/orte.php b/orte.php index a5f426c..1188d34 100644 --- a/orte.php +++ b/orte.php @@ -3,7 +3,7 @@ - Meine Website + Orte