diff --git a/install.php b/install.php index c244bd3..b57e1e4 100644 --- a/install.php +++ b/install.php @@ -79,18 +79,8 @@ function install($type, $host, $user, $pass, $dbname, $lang, $mysqlcon, &$err_ms $err_lvl = 2; } else { $count = 1; - $stmt = $mysqlcon->query('SHOW DATABASES'); - while ($row = $stmt->fetch(PDO::FETCH_ASSOC)) { - if ($row['Database'] == $dbname) { - $dbExists = true; - break; - } - } - if ($dbExists) { - if(($mysqlcon->exec("DROP DATABASE `$dbname`")) === false) { } - } - - if($mysqlcon->exec("CREATE DATABASE `$dbname`") === false) { + + if($mysqlcon->exec("CREATE DATABASE IF NOT EXISTS `$dbname`") === false) { $err_msg .= $lang['isntwidbmsg'].$mysqlcon->errorCode()." ".print_r($mysqlcon->errorInfo(), true).'
'; $err_lvl = 2; $count++; } @@ -1072,4 +1062,4 @@ function install($type, $host, $user, $pass, $dbname, $lang, $mysqlcon, &$err_ms }); - \ No newline at end of file +