Here is our db.php
$host = 'localhost';
$username = 'root';
$password = '';
try
{
$conn = new PDO("mysql:host=".$host.", $username, $password);
$conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$sql = "CREATE DATABASE IF NOT EXISTS teacher";
$conn->exec($sql);
$sql = "use teacher";
$conn->exec($sql);
}
catch(PDOException $e)
{
echo "Error".$e->getMessage();
}
..
There was an error!
Parse error: syntax error, unexpected 'CREATE' (T_STRING) in
How to solve this.