Improve error handling in API and enhance JSON parsing in script.js

This commit is contained in:
vista-man committed 2025-03-18 10:21:59 +01:00
1 parent 59643b91c2
commit 048ca0e86f
2 files changed
+10 -2

No files matched your search

+1 -1
View File
@@ -10,7 +10,7 @@ $conn = new mysqli($servername, $username, $password, $dbname);
// Check connection
if ($conn->connect_error) {
error_log("Connection failed: " . $conn->connect_error);
die("Connection failed: " . $conn->connect_error);
die(json_encode(['error' => "Connection failed: " . $conn->connect_error]));
}
header('Content-Type: application/json');