Got it solved by doing a print of $row. It gave as output:
Array ( [0] => information_schema [Database] => information_schema )
So I should have used Database with a kapital D, but now this gives the output:
$dbname
mysql
So it has used the variable name as the database directory (which I can see when browsing to the mysql db folder), where it should have used its value according to below script ('testing'). What should I do to have it make a 'testing' directory?
<?php
// Basisinformatie
$dbhost='localhost';
$dbusername='***';
$dbpassword='***';
$dbname='testing';
// Maak verbinding met mysql database server.
$dbcnx = mysql_connect ($dbhost, $dbusername, $dbpassword);
echo "Verbinding met database!";
// Database aanmaken.
$sql = 'CREATE DATABASE $dbname';
if (@mysql_query($sql)) {
echo '<p>Database '.$dbname.' is aangemaakt!</p>';
} else {
exit('<p>Fout bij aanmaken database: ' .
mysql_error() . '</p>');
}
?>