From 4c60d501b58694b27e62b8a6e06e599b4d9a5784 Mon Sep 17 00:00:00 2001 From: Florian Date: Wed, 23 Aug 2017 23:38:16 +0200 Subject: [PATCH] fixing deprecated stuff removed deprecated functions adpating to db-structure --- exampleAddOns/alarmMonitorWeb/tpl/a_header.php | 3 ++- .../alarmMonitorWeb/tpl/mysql.class.php | 16 ++++++++-------- exampleAddOns/alarmMonitorWeb/tpl/pocsag.php | 8 ++++---- 3 files changed, 14 insertions(+), 13 deletions(-) diff --git a/exampleAddOns/alarmMonitorWeb/tpl/a_header.php b/exampleAddOns/alarmMonitorWeb/tpl/a_header.php index 3614643..866b34f 100644 --- a/exampleAddOns/alarmMonitorWeb/tpl/a_header.php +++ b/exampleAddOns/alarmMonitorWeb/tpl/a_header.php @@ -41,7 +41,8 @@
  • FMS
  • ZVEI
  • Einstellungen
  • -
  • Nutzer anlegen
  • +
  • Nutzer anlegen
  • +
  • Ausloggen
  • diff --git a/exampleAddOns/alarmMonitorWeb/tpl/mysql.class.php b/exampleAddOns/alarmMonitorWeb/tpl/mysql.class.php index 69d5fbd..3910fd9 100644 --- a/exampleAddOns/alarmMonitorWeb/tpl/mysql.class.php +++ b/exampleAddOns/alarmMonitorWeb/tpl/mysql.class.php @@ -23,16 +23,16 @@ Simple Database Class (C) by Bastian Schroll function __construct($host, $user, $password, $database, $show_error = 1) { $this->show_error = $show_error; - @$this->conn = mysql_connect($host, $user, $password); + @$this->conn = mysqli_connect($host, $user, $password); if ($this->conn == false) { - $this->error("Keine Verbindung zum Datenbank Server!", mysql_error()); + $this->error("Keine Verbindung zum Datenbank Server!", mysqli_error($this->conn)); return false; } - if (!@mysql_select_db($database, $this->conn)) + if (!@mysqli_select_db($this->conn, $database)) { - $this->error("Datenbank nicht gefunden!", mysql_error()); + $this->error("Datenbank nicht gefunden!", mysqli_error($this->conn)); return false; } return true; @@ -48,10 +48,10 @@ Simple Database Class (C) by Bastian Schroll */ function query($query) { - $this->result = @mysql_query($query, $this->conn); + $this->result = @mysqli_query($this->conn, $query); if ($this->result == false) { - $this->error("Fehlerhafte Datenbank Anfrage!", mysql_error()); + $this->error("Fehlerhafte Datenbank Anfrage!", mysqli_error($this->conn)); return false; } return $this->result; @@ -69,10 +69,10 @@ Simple Database Class (C) by Bastian Schroll { if ($result != null) { - return @mysql_fetch_assoc($result); + return @mysqli_fetch_assoc($result); } else { - return @mysql_fetch_assoc($this->result); + return @mysqli_fetch_assoc($this->result); } } diff --git a/exampleAddOns/alarmMonitorWeb/tpl/pocsag.php b/exampleAddOns/alarmMonitorWeb/tpl/pocsag.php index 4e4c6f2..5e86ebb 100644 --- a/exampleAddOns/alarmMonitorWeb/tpl/pocsag.php +++ b/exampleAddOns/alarmMonitorWeb/tpl/pocsag.php @@ -10,7 +10,7 @@ query("SELECT id, time, ric, funktion, text, description FROM ".$tablePOC." ORDER BY id DESC LIMIT 100"); + $db->query("SELECT id, time, ric, function, msg, description FROM ".$tablePOC." ORDER BY id DESC LIMIT 100"); $Rows = array(); while ($daten = $db->fetchAssoc()) { @@ -29,11 +29,11 @@ // echo "". $poc['id'] . ""; // echo "". $poc['description'] . ""; - echo "". $poc['text'] . ""; + echo "". $poc['msg'] . ""; echo "". $time . ""; echo "". $poc['ric'] . ""; - echo "". $poc['funktion'] . ""; + echo "". $poc['function'] . ""; echo ""; } ?> - \ No newline at end of file +