Answer the question
In order to leave comments, you need to log in
Error adding to database?
Do not enter any text with an error, it is simply not added to the database
$dsn = 'mysql:host=localhost;dbname=prpr';
$pdo = new PDO($dsn , 'root', '');
$title = $_POST['title'];
$txt = $_POST['txt'];
$sel = $_POST['sel'];
$sql = "INSERT INTO forum(title,txt,sel) VALUES(:title,:txt,:sel)";
$query = $pdo->prepare($sql);
$query->execute(['title' => $title, 'txt' => $txt, 'sel' => $sel]);
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question