diff options
-rw-r--r-- | installer/installer.php | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/installer/installer.php b/installer/installer.php index 9279613b..9a3f83f9 100644 --- a/installer/installer.php +++ b/installer/installer.php @@ -146,12 +146,13 @@ class installer { return; } - if (!mysql_select_db($config["dbname"]) && - !function_exists("mysql_create_db") || - !mysql_create_db($config["dbname"])) { - $errors["Database"] = sprintf( - "Database '%s' is not defined and can't be created", - $config["dbname"]); + if (!mysql_select_db($config["dbname"])) { + if (!(mysql_query("CREATE DATABASE {$config['dbname']}") && + mysql_select_db($config["dbname"]))) { + $errors["Database"] = sprintf( + "Database '%s' is not defined and can't be created", + $config["dbname"]); + } } if (empty($errors) && mysql_num_rows(mysql_query("SHOW TABLES FROM {$config['dbname']}"))) { |