From 2330bb06ececee220d854883a2870a3adf17c277 Mon Sep 17 00:00:00 2001 From: root Date: Sun, 19 Oct 2014 03:54:53 +0200 Subject: Version 4.1. Support for photo galleries and advanced caching. --- class/mysql.php | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'class/mysql.php') diff --git a/class/mysql.php b/class/mysql.php index 8d75538..eea5f95 100644 --- a/class/mysql.php +++ b/class/mysql.php @@ -72,6 +72,10 @@ class db { return true; } + public function affectedRows(){ + return $this->db->affected_rows; + } + # code by WordPress. See @link https://core.trac.wordpress.org/browser/branches/4.0/src/wp-includes/wp-db.php#L1154 # syntax like sprintf() public function prepare( $query, $args ) { @@ -143,7 +147,18 @@ class db { ) ENGINE=InnoDB;'; - if ( ! $this->execMultipleQueries('BEGIN; '. $user_table . ' ' . $banned_user_table . ' ' . $jg_table . ' COMMIT;') ) + $gallery_table = + 'CREATE TABLE IF NOT EXISTS ' . DBPREFIX . 'gallery + ( id INTEGER AUTO_INCREMENT NOT NULL, PRIMARY KEY(id), + name varchar(70), UNIQUE(name), + description varchar(500), + owner INTEGER, FOREIGN KEY(owner) REFERENCES ' . DBPREFIX . 'user(id), + restricted INTEGER, + time INTEGER + ) + ENGINE=InnoDB;'; + + if ( ! $this->execMultipleQueries('BEGIN; '. $user_table . ' ' . $banned_user_table . ' ' . $jg_table . ' ' . $gallery_table . ' COMMIT;') ) failure("
There was a problem during bootstrapping the database schema. " . $this->db->error . "
", '500 Server Failure', false, "