Catch PDOException in header.php

This commit is contained in:
ruan 2015-10-16 14:51:01 +02:00
parent ac801e1543
commit b8b4d25b70

View File

@ -2,6 +2,7 @@
namespace litebans;
use PDO;
use PDOException;
class Header {
/**
@ -15,6 +16,7 @@ function __construct($page) {
$t_mutes = $t['mutes'];
$t_warnings = $t['warnings'];
$t_kicks = $t['kicks'];
try {
$st = $page->conn->query("SELECT
(SELECT COUNT(*) FROM $t_bans) AS c_bans,
(SELECT COUNT(*) FROM $t_mutes) AS c_mutes,
@ -27,6 +29,9 @@ function __construct($page) {
'warnings.php' => $row['c_warnings'],
'kicks.php' => $row['c_kicks'],
);
} catch (PDOException $ex) {
die($ex->getMessage());
}
}
}