spinn_mit/system/ideeSpeichern.php

24 lines
369 B
PHP
Raw Normal View History

<?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();
?>