mirror of
https://gitlab.com/ruany/litebans-php.git
synced 2025-05-24 00:42:43 +00:00
Fixed more possible error instances
This commit is contained in:
parent
534e0d2ca2
commit
5074cbfc5f
@ -19,6 +19,7 @@ function __construct($page) {
|
|||||||
(SELECT COUNT(*) FROM $t_warnings) AS c_warnings,
|
(SELECT COUNT(*) FROM $t_warnings) AS c_warnings,
|
||||||
(SELECT COUNT(*) FROM $t_kicks) AS c_kicks");
|
(SELECT COUNT(*) FROM $t_kicks) AS c_kicks");
|
||||||
($row = $st->fetch(PDO::FETCH_ASSOC)) or die('Failed to fetch row counts.');
|
($row = $st->fetch(PDO::FETCH_ASSOC)) or die('Failed to fetch row counts.');
|
||||||
|
$st->closeCursor();
|
||||||
$this->count = array(
|
$this->count = array(
|
||||||
'bans.php' => $row['c_bans'],
|
'bans.php' => $row['c_bans'],
|
||||||
'mutes.php' => $row['c_mutes'],
|
'mutes.php' => $row['c_mutes'],
|
||||||
|
@ -401,7 +401,9 @@ class Page {
|
|||||||
$where = $this->where_append($this->name === "kicks" ? "" : $this->settings->active_query);
|
$where = $this->where_append($this->name === "kicks" ? "" : $this->settings->active_query);
|
||||||
$where .= "(uuid <> '#offline#' AND uuid IS NOT NULL)";
|
$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'];
|
$total = $result['count'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -143,6 +143,7 @@ final class Settings {
|
|||||||
|
|
||||||
$st = $this->conn->query("SELECT * FROM " . $this->table['servers'] . " LIMIT 1;");
|
$st = $this->conn->query("SELECT * FROM " . $this->table['servers'] . " LIMIT 1;");
|
||||||
$st->fetch();
|
$st->fetch();
|
||||||
|
$st->closeCursor();
|
||||||
} catch (PDOException $e) {
|
} catch (PDOException $e) {
|
||||||
Settings::handle_error($this, $e);
|
Settings::handle_error($this, $e);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user