mirror of
https://gitlab.com/ruany/litebans-php.git
synced 2025-07-10 07:47:34 +00:00
Restructure connect()
This commit is contained in:
parent
15d5e9706a
commit
82231518a4
@ -34,15 +34,15 @@ function connect() {
|
|||||||
|
|
||||||
$conn = new mysqli($dbhost, $username, $password, $database);
|
$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_bans = $table_prefix . "bans";
|
||||||
$table_mutes = $table_prefix . "mutes";
|
$table_mutes = $table_prefix . "mutes";
|
||||||
$table_warnings = $table_prefix . "warnings";
|
$table_warnings = $table_prefix . "warnings";
|
||||||
$table_history = $table_prefix . "history";
|
$table_history = $table_prefix . "history";
|
||||||
|
|
||||||
if ($conn->connect_errno > 0) {
|
|
||||||
die('Unable to connect to database: ' . $conn->connect_error);
|
|
||||||
}
|
|
||||||
|
|
||||||
$active_query = "WHERE active=1";
|
$active_query = "WHERE active=1";
|
||||||
if ($show_inactive_bans) {
|
if ($show_inactive_bans) {
|
||||||
$active_query = "";
|
$active_query = "";
|
||||||
|
Loading…
x
Reference in New Issue
Block a user