Restore getUserMemberStatus function to original implementation and fix database queries
This commit is contained in:
@@ -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');
|
||||
?>
|
||||
|
||||
Reference in New Issue
Block a user