marker anklicken zeigt infos aus datenbank in DOM an

This commit is contained in:
Marlon Portmann committed 2022-10-27 12:35:35 +02:00
1 parent 6a1589227a
commit 49ba7be5ee
6 files changed
+135 -10

No files matched your search

+23
View File
@@ -0,0 +1,23 @@
<?php
require_once('data.php');
?>
<?php
$db = dbVerbindungErzeugen();
if(isset($_POST['titel'])){
$titel = $_POST['titel'];
}
if(isset($_POST['inhalt'])){
$inhalt = $_POST['inhalt'];
}
$sql = "INSERT INTO idee (titel, inhalt) VALUES (?, ?)";
$stmt = $db->prepare($sql);
$stmt->execute(array($titel, $inhalt));
echo $db->lastInsertId();
?>