From 82231518a43f5acb7d95d7cbb62a43e8ae484678 Mon Sep 17 00:00:00 2001 From: Ruan Date: Thu, 12 Mar 2015 08:13:22 +0200 Subject: [PATCH] Restructure connect() --- includes/settings.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/includes/settings.php b/includes/settings.php index 70563ec..de07edf 100644 --- a/includes/settings.php +++ b/includes/settings.php @@ -34,15 +34,15 @@ function connect() { $conn = new mysqli($dbhost, $username, $password, $database); + if ($conn->connect_errno > 0) { + die('Unable to connect to database: ' . $conn->connect_error); + } + $table_bans = $table_prefix . "bans"; $table_mutes = $table_prefix . "mutes"; $table_warnings = $table_prefix . "warnings"; $table_history = $table_prefix . "history"; - if ($conn->connect_errno > 0) { - die('Unable to connect to database: ' . $conn->connect_error); - } - $active_query = "WHERE active=1"; if ($show_inactive_bans) { $active_query = "";