Fixed "Setup tries to create database lychee_dbcheck #202"
This commit is contained in:
parent
28f8aab323
commit
1d57a13267
@ -73,10 +73,16 @@ class Database extends Module {
|
|||||||
|
|
||||||
if ($database->connect_errno) return 'Warning: Connection failed!';
|
if ($database->connect_errno) return 'Warning: Connection failed!';
|
||||||
|
|
||||||
# Check if user can create a database
|
# Check if database exists
|
||||||
$result = $database->query('CREATE DATABASE lychee_dbcheck');
|
if (!$database->select_db($name)) {
|
||||||
if (!$result) return 'Warning: Creation failed!';
|
|
||||||
else $database->query('DROP DATABASE lychee_dbcheck');
|
# Database doesn't exist
|
||||||
|
# Check if user can create a database
|
||||||
|
$result = $database->query('CREATE DATABASE lychee_dbcheck');
|
||||||
|
if (!$result) return 'Warning: Creation failed!';
|
||||||
|
else $database->query('DROP DATABASE lychee_dbcheck');
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
# Save config.php
|
# Save config.php
|
||||||
$config = "<?php
|
$config = "<?php
|
||||||
|
Loading…
Reference in New Issue
Block a user