I have installed PHP, Apache and MySQL manually on my MacBook and I'm following a book about how to create the table without using phpMyAdmin. My script doesn't seem to be creating the DNS, however, it doesn't throw any exceptions. Any suggestions, guys? Thanks in advance.
This is my code: file name: setup.php
<?php
print("Created.\n"); // This statement prints
$db = new PDO("mysql:host=localhost;dbname=MyBlog", "username", "password");
$db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
print("Created.\n"); // This statement does not print
try {
$queryStr = "CREATE TABLE users (id INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY,
name VARCHAR(40), password VARCHAR(100), email VARCHAR(150))";
$db->query($queryStr);
print("Created.\n");
} catch (PDOException $e) {
echo $e->getMessage();
}