From 1d5c8cb96ad9a1a9f61991a19b1362142b074430 Mon Sep 17 00:00:00 2001 From: Andreas Jakum Date: Tue, 20 Oct 2020 21:23:26 +0200 Subject: Migrate to mysqli to support PHP7.4 instead of stone-age PHP5.6 .. --- db.class.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/db.class.php b/db.class.php index 1a3647f..afe463d 100644 --- a/db.class.php +++ b/db.class.php @@ -13,33 +13,33 @@ function DB($user, $pass, $host, $dbname) { } function connect() { - $this->db = mysql_connect($this->host, $this->user, $this->pass) + $this->db = mysqli_connect($this->host, $this->user, $this->pass) or $this->error("Verbindungsaufbau fehlgeschlagen"); - mysql_select_db($this->dbname); + mysqli_select_db($this->db, $this->dbname); } function error($msg) { - die($msg . ": " . @mysql_error()); + die($msg . ": " . @mysqli_error($this->db)); } function query($query) { - $this->res = mysql_query($query, $this->db) + $this->res = mysqli_query($this->db, $query) or $this->error("Fehler bei Datenbankanfrage"); } function escape_string($string) { - return mysql_real_escape_string($string, $this->db); + return mysqli_real_escape_string($this->db, $string); } function numObjects() { - return mysql_num_rows($this->res); + return mysqli_num_rows($this->res); } function getNextObject() { if (!$this->res) { return; } - return mysql_fetch_object($this->res); + return mysqli_fetch_object($this->res); } } -- cgit v1.2.1