I'm trying to write a script that will take the username and password from a form and create a database called "mydatabase". Once the database is created, the script will insert the tables I need. It keeps saying "Error creating database.". Does anyone have any thoughts on this?
$link = mysql_pconnect("localhost", $username, $password)
or die("Could not connect: " . mysql_error());
$sql = "CREATE DATABASE mydatabase";
if (mysql_query($sql)) {
print ("Database created successfully.");
} else {
printf ("Error creating database.", mysql_error());
}