24 lines
369 B
PHP
24 lines
369 B
PHP
|
<?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();
|
||
|
|
||
|
?>
|