From b015ef275ffdb33cf3fa4904fd6adf59be3e59b9 Mon Sep 17 00:00:00 2001 From: Yasen Pramatarov Date: Sat, 9 Nov 2024 13:06:43 +0200 Subject: [PATCH] Fixes database connection --- public_html/index.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/public_html/index.php b/public_html/index.php index 8875962..3beef60 100644 --- a/public_html/index.php +++ b/public_html/index.php @@ -97,7 +97,13 @@ if ( !isset($_COOKIE['username']) && ($page !== 'login' && $page !== 'register') // connect to db of Jilo Web require '../app/classes/database.php'; require '../app/helpers/database.php'; -$dbWeb = connectDB($config); +$response = connectDB($config); +if ($response['db'] === null) { + $error = $response['error']; + include '../app/templates/block-message.php'; +} else { + $dbWeb = $response['db']; +} // start logging require '../app/classes/log.php';