fixing deprecated stuff

removed deprecated functions
adpating to db-structure
This commit is contained in:
Florian 2017-08-23 23:38:16 +02:00 committed by GitHub
parent 61398d95cb
commit 4c60d501b5
3 changed files with 14 additions and 13 deletions

View file

@ -41,7 +41,8 @@
<li><a href="show_fms.php">FMS</a></li>
<li><a href="show_zvei.php">ZVEI</a></li>
<li><a href="prefs.php">Einstellungen</a></li>
<li><a href="eintragen.html">Nutzer anlegen</a></li>
<li><a href="eintragen.php">Nutzer anlegen</a></li>
<li><a href="logout.php">Ausloggen</a></li>
</ul>
</nav>

View file

@ -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);
}
}

View file

@ -10,7 +10,7 @@
</tr>
<?php
$db->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 "<td>". $poc['id'] . "</td>";
//
echo "<td>". $poc['description'] . "</td>";
echo "<td>". $poc['text'] . "</td>";
echo "<td>". $poc['msg'] . "</td>";
echo "<td>". $time . "</td>";
echo "<td>". $poc['ric'] . "</td>";
echo "<td>". $poc['funktion'] . "</td>";
echo "<td>". $poc['function'] . "</td>";
echo "</tr>";
}
?>
</table>
</table>