24 lines
653 B
PHP
24 lines
653 B
PHP
<?php
|
|
|
|
$dbhost = $_ENV['DB_HOST'];
|
|
$dbuser = $_ENV['DB_USER'];
|
|
$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) {
|
|
// 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');
|
|
?>
|