From 418624000ff1d32204914bd9177bcedf985db4ed Mon Sep 17 00:00:00 2001 From: Jorge Rincon Date: Fri, 29 Sep 2023 09:21:08 +0200 Subject: [PATCH] #12142 Caught bd exception in php version 8.0 and 8.2 --- pandora_console/include/db/mysql.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/pandora_console/include/db/mysql.php b/pandora_console/include/db/mysql.php index 66510a1898..e8e7a6b020 100644 --- a/pandora_console/include/db/mysql.php +++ b/pandora_console/include/db/mysql.php @@ -80,8 +80,13 @@ function mysql_connect_db( // If you want persistent connections change it to mysql_pconnect(). if ($config['mysqli']) { if (empty($ssl)) { - $connect_id = mysqli_connect($host, $user, $pass, $db, $port); - if (mysqli_connect_errno() > 0) { + try { + $connect_id = mysqli_connect($host, $user, $pass, $db, $port); + if (mysqli_connect_errno() > 0) { + include 'general/mysqlerr.php'; + return false; + } + } catch (\mysqli_sql_exception $e) { include 'general/mysqlerr.php'; return false; }