diff options
Diffstat (limited to 'db.class.php')
-rw-r--r-- | db.class.php | 14 |
1 files 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); } } |