I'm wondering if there is something in your setup that isn't allowing your script to see the same database that your myphpadmin is.
However, try this script and see what happens. If it doesn't fail, then try your script again:
PHP Code:
$link = mysqli_connect('localhost', 'root', '');
if (!$link) {
echo 'Unable to connect to the database server.';
exit();
}
$sql = 'CREATE DATABASE `ijdb` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci';
$query = mysqli_query($link, $sql) or die( mysqli_error( $link ) );
I tested this and it worked on my machine.
Bookmarks