I'm trying to create a database using a PHP page loaded on localhost on my PC using the following code:
// Connect to MySQL
$linkdb = mysql_connect('localhost', 'root', '***********');
if (!$linkdb) {
die('Could not connect: '.mysql_error());
}
// Make my_db the current database
$db_selected = mysql_select_db('movie_db', $linkdb);
if (!$db_selected) {
// If we couldn't, then it either doesn't exist, or we can't see it.
$sql = 'CREATE DATABASE movie_db';
if (mysql_query($sql, $linkdb)) {
echo "Database movie_db created successfully\n";
} else {
echo 'Error creating database: '.mysql_error()."\n";
}
}
mysql_close($linkdb);
As I loaded the page on the browser the first time at
localhost/~"my name"/
I got this
Database movie_db created successfully
meaning that the database was created. The problem is that I can't find the database anywhere. When should it be stored? Is there anyway to save it in the same folder of the .php file?