summaryrefslogtreecommitdiff
path: root/public_html/class/mysql.php
diff options
context:
space:
mode:
Diffstat (limited to 'public_html/class/mysql.php')
-rw-r--r--public_html/class/mysql.php8
1 files changed, 5 insertions, 3 deletions
diff --git a/public_html/class/mysql.php b/public_html/class/mysql.php
index 0031eec..d0c6949 100644
--- a/public_html/class/mysql.php
+++ b/public_html/class/mysql.php
@@ -12,7 +12,7 @@ class vfsdb {
try {
$this->db = new mysqli(DBHOST, DBUSER, DBPASSWORD, DBNAME);
} catch (Exception $e){
- failure($e->getMessage(), '<p>500 Server Failure</p>', false, '<h1>Failed to open database.</h1>');
+ failure("<p>".$e->getMessage()."</p>", '500 Server Failure', false, '<h1>Failed to open database connection.</h1>');
}
if ( $this->db->connect_errno() ){
@@ -24,7 +24,7 @@ class vfsdb {
}
if ( ! $this->db->set_charset(DBCHARSET) ){
- failure("<p>Can't set UTF-8 as a charset on your MySQL server.</p>" , '500 Server Failure', false, "<h1>Setting Charset failed!</h1>");
+ failure("<p>Can't set " . DBCHARSET . " as the charset on your MySQL server.</p>" , '500 Server Failure', false, "<h1>Setting Charset failed!</h1>");
}
}
@@ -73,6 +73,7 @@ class vfsdb {
color_folder VARCHAR(70),
color_file VARCHAR(70))
ENGINE=InnoDB;';
+
$files_table =
'CREATE TABLE IF NOT EXISTS ' . DBPREFIX . 'files
( files_id INTEGER AUTO_INCREMENT NOT NULL, PRIMARY KEY(files_id),
@@ -90,6 +91,7 @@ class vfsdb {
FOREIGN KEY(files_id) REFERENCES user(id) ON DELETE CASCADE
)
ENGINE=InnoDB;';
+
$banned_user_table =
'CREATE TABLE IF NOT EXISTS ' . DBPREFIX . 'banned_user
( banned_id INTEGER AUTO_INCREMENT NOT NULL, PRIMARY KEY(banned_id),
@@ -102,7 +104,7 @@ class vfsdb {
ENGINE=InnoDB;';
if ( ! $this->db->query($user_table . ' ' . $files_table . ' ' . $banned_user_table) )
- failure("<p>Setting up the database failed.</p>", '500 Server Failure', false, "<h1>CREATE TABLE FAILED");
+ failure("<p>There was a problem during bootstrapping the database schema. " . $this->db->error . "</p>", '500 Server Failure', false, "<h1>CREATE TABLE FAILED</h1>");
}
public function __destruct(){