diff options
| author | root | 2014-10-19 03:54:53 +0200 |
|---|---|---|
| committer | root | 2014-10-19 03:54:53 +0200 |
| commit | 2330bb06ececee220d854883a2870a3adf17c277 (patch) | |
| tree | e49f6b561faf5b39a81d57d54fa57a1550074c0f /class/mysql.php | |
| parent | a3009bf57d50fbc25a707b32fb3c5c170d011680 (diff) | |
| download | jungegemeinde-2330bb06ececee220d854883a2870a3adf17c277.tar.gz | |
Version 4.1. Support for photo galleries and advanced caching.
Diffstat (limited to 'class/mysql.php')
| -rw-r--r-- | class/mysql.php | 17 |
1 files changed, 16 insertions, 1 deletions
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("<p>There was a problem during bootstrapping the database schema. " . $this->db->error . "</p>", '500 Server Failure', false, "<h1>CREATE TABLE FAILED</h1>"); } |
