Fix bug 484

Hui-Organize
Lan Hui 2024-10-07 07:52:22 +08:00
parent 0f42a68461
commit 9d170fea87
1 changed files with 6 additions and 3 deletions

View File

@ -4,11 +4,14 @@ error_reporting(0);
date_default_timezone_set('Asia/Shanghai'); date_default_timezone_set('Asia/Shanghai');
include "get_mysql_credentials.php"; include "get_mysql_credentials.php";
try {
$con = mysqli_connect("localhost", $mysql_username, $mysql_password, "lrr"); $con = mysqli_connect("localhost", $mysql_username, $mysql_password, "lrr");
} catch (mysqli_sql_exception $e) {
echo $e->getMessage();
}
// Check database connection // Check database connection
if (mysqli_connect_errno()) { if (mysqli_connect_errno()) {
echo "Failed to connect to MySQL: " . mysqli_connect_error(); exit();
} }
?> ?>