Warning: Undefined array key "url" in C:\Users\User\Desktop\projetos php\aluraplay\novo-video.php on line 8
Warning: Undefined array key "titulo" in C:\Users\User\Desktop\projetos php\aluraplay\novo-video.php on line 9 bool(true)
<?php
$dbPath = __DIR__ . '/banco.sqlite';
$pdo = new PDO("sqlite:$dbPath");
$sql = 'INSERT INTO videos (url, title) VALUES (?, ?)';
$statement = $pdo->prepare($sql);
$statement->bindValue(1, $_POST['url']);
$statement->bindValue(2, $_POST['titulo']);
var_dump($statement->execute());