diff --git a/app/pages/components.php b/app/pages/components.php index 5bddeb2..2fe658d 100644 --- a/app/pages/components.php +++ b/app/pages/components.php @@ -3,7 +3,13 @@ require '../app/classes/component.php'; // connect to database -$db = connectDB($config, 'jilo', $platformDetails[0]['jilo_database'], $platform_id); +$response = connectDB($config, 'jilo', $platformDetails[0]['jilo_database'], $platform_id); +if ($response['db'] === null) { + $error = $response['error']; + include '../app/templates/block-message.php'; +} else { + $db = $response['db']; +} // specify time range include '../app/helpers/time_range.php';