From bb73a2d896ba7686a4af8a0382c7bc8487e1ef16 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Mon, 19 Jan 2009 18:16:25 +0000 Subject: Replace mysql_create_db with a mysql_query() call as recommended by the PHP manual. --- installer/installer.php | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'installer') 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']}"))) { -- cgit v1.2.3