From ec761c2c54eb0ba4987850db7173060ddbe4ea95 Mon Sep 17 00:00:00 2001 From: Niklas Meinzer Date: Sat, 10 May 2025 19:16:37 +0200 Subject: [PATCH] Add page to add new meal --- signup/add.php | 98 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 98 insertions(+) create mode 100644 signup/add.php diff --git a/signup/add.php b/signup/add.php new file mode 100644 index 0000000..b468e5c --- /dev/null +++ b/signup/add.php @@ -0,0 +1,98 @@ + + + + + + Termin hinzufügen + + + +
+
+
+ Logo +

Termin hinzufügen

+
+
+
+ +
+

Neuen Termin hinzufügen

+
+ + + + + + + + + + + + + + + + +
+ + setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); + + // SQL query to insert a new dinner option + $sql = "INSERT INTO meals (title, link, event_date, registration_closes) VALUES (:title, :melly, :date, :deadline)"; + $stmt = $pdo->prepare($sql); + + // Bind parameters + $stmt->bindParam(':title', $title); + $stmt->bindParam(':melly', $melly); + $stmt->bindParam(':date', $date); + $stmt->bindParam(':deadline', $deadline); + + // Execute the statement + $stmt->execute(); + + echo '

Dinner option added successfully!

'; + + } catch (PDOException $e) { + // Handle connection or query error + echo "Error: " . $e->getMessage(); + } + } + } + ?> +
+ +