I am new to PhP , and i am kind of stuck with this problem : i have a database created end when i try to use PDO exec() to create a table nothing happends , no table is created, no error message is displayed .I tryed validating my code online and got no error.Please help.Thanks.
$host = 'localhost';
$db = 'test';
$user = 'root';
$pass = '';
try{
$connect = new PDO("mysql:host = $host ; dbname = $db", $user , $pass);
$sql = "CREATE TABLE IF NOT EXISTS book(
id INT(20) NOT NULL UNSIGNED AUTO_INCREMENT PRIMARY KEY,
title VARCHAR(20) NOT NULL,
autor VARCHAR(20) NOT NULL
)";
$connect->exec($sql);
$connect = null;
}catch(PDOException $e){
$e->getMessage();
}