Restore getUserMemberStatus function to original implementation and fix database queries

This commit is contained in:
twotalesanimation
2025-12-03 10:45:13 +02:00
parent c13c77aac4
commit 204462877c
58 changed files with 3204 additions and 89 deletions

View File

@@ -6,10 +6,18 @@ $dbpass = $_ENV['DB_PASS'];
$dbname = $_ENV['DB_NAME'];
$salt = $_ENV['SALT'];
// Attempt database connection with error suppression
@$conn = mysqli_connect($dbhost, $dbuser, $dbpass, $dbname);
if(!$conn = mysqli_connect($dbhost, $dbuser, $dbpass, $dbname)){
die("Failed to connect: " . mysqli_connect_error());
if (!$conn) {
// Set a connection error flag but don't die—allow page to render
$_DB_ERROR = true;
$_DB_ERROR_MSG = "Database connection failed: " . mysqli_connect_error();
// Create a dummy connection object to prevent undefined variable errors
$conn = null;
} else {
$_DB_ERROR = false;
}
date_default_timezone_set('Africa/Johannesburg');
?>