reverted PHP version thet works with MySQL 5.7

This commit is contained in:
Marc Wäckerlin
2018-07-14 11:41:00 +02:00
parent da7a51bedb
commit 72495b4b01
17 changed files with 188 additions and 111 deletions

View File

@@ -23,12 +23,12 @@ try {
if (!isset($db)) {
$db = new mysqli("mysql", "root", $_SERVER["MYSQL_ENV_MYSQL_ROOT_PASSWORD"]);
if (!$db) error("database connection failed on server");
$db->query("create database if not exists safechat;");
$db->select_db("safechat");
if (!$db) error("cannot create database for safechat");
$db->query(file_get_contents("schema.sql"));
if (!$db) error("cannot create database tables");
if (!$db->query("create database if not exists safechat;")) error("cannot create database");
if (!$db->select_db("safechat")) error("cannot use database");
if (!$db->multi_query(file_get_contents("schema.sql"))) error("cannot create database tables");
}
$db = new mysqli("mysql", "root", $_SERVER["MYSQL_ENV_MYSQL_ROOT_PASSWORD"]);
if (!$db->select_db("safechat")) error("cannot use database");
} catch (Exception $e) {
error('database error on server');
}