Fixed more possible error instances

This commit is contained in:
ruan 2016-10-04 02:36:26 +02:00
parent 534e0d2ca2
commit 5074cbfc5f
No known key found for this signature in database
GPG Key ID: 062534EE618F498C
3 changed files with 5 additions and 1 deletions

View File

@ -19,6 +19,7 @@ function __construct($page) {
(SELECT COUNT(*) FROM $t_warnings) AS c_warnings,
(SELECT COUNT(*) FROM $t_kicks) AS c_kicks");
($row = $st->fetch(PDO::FETCH_ASSOC)) or die('Failed to fetch row counts.');
$st->closeCursor();
$this->count = array(
'bans.php' => $row['c_bans'],
'mutes.php' => $row['c_mutes'],

View File

@ -401,7 +401,9 @@ class Page {
$where = $this->where_append($this->name === "kicks" ? "" : $this->settings->active_query);
$where .= "(uuid <> '#offline#' AND uuid IS NOT NULL)";
$result = $this->conn->query("SELECT COUNT(*) AS count FROM $table $where")->fetch(PDO::FETCH_ASSOC);
$st = $this->conn->query("SELECT COUNT(*) AS count FROM $table $where");
$result = $st->fetch(PDO::FETCH_ASSOC);
$st->closeCursor();
$total = $result['count'];
}

View File

@ -143,6 +143,7 @@ final class Settings {
$st = $this->conn->query("SELECT * FROM " . $this->table['servers'] . " LIMIT 1;");
$st->fetch();
$st->closeCursor();
} catch (PDOException $e) {
Settings::handle_error($this, $e);
}