PHP Fatal error: Uncaught PDOException: SQLSTATE[HY000]: General error: 1 incomplete input in C:\wsts\PHP\php-pdo\inserir-aluno.php:21 Stack trace:
#0 C:\wsts\PHP\php-pdo\inserir-aluno.php(21): PDO->exec('INSERT INTO stu...')
#1 {main} thrown in C:\wsts\PHP\php-pdo\inserir-aluno.php on line 21
Fatal error: Uncaught PDOException: SQLSTATE[HY000]: General error: 1 incomplete input in C:\wsts\PHP\php-pdo\inserir-aluno.php:21 Stack trace:
#0 C:\wsts\PHP\php-pdo\inserir-aluno.php(21): PDO->exec('INSERT INTO stu...')
#1 {main} thrown in C:\wsts\PHP\php-pdo\inserir-aluno.php on line 21
` <?php
use Alura\Pdo\Domain\Model\Student;
require_once 'vendor/autoload.php';
$databasePath = DIR . '/banco.sqlite'; $pdo = new PDO('sqlite:' . $databasePath);
$student = new Student( null, 'Caique Leme', new \DateTimeImmutable('2004-01-24') );
$sqlInsert = "INSERT INTO students (name, birth_date) VALUES ( '{$student -> name()}', '{$student -> birthDate() -> format('Y-m-d')}' ";
var_dump($pdo -> exec($sqlInsert)); `