Merge branch 'ent-12142-error-500-cuando-la-consola-no-conecta-con-la-DB' into 'develop'

Ent 12142 error 500 cuando la consola no conecta con la db

See merge request artica/pandorafms!6515
This commit is contained in:
Rafael Ameijeiras 2023-10-02 10:02:50 +00:00
commit 958c428e91

View File

@ -80,11 +80,16 @@ function mysql_connect_db(
// If you want persistent connections change it to mysql_pconnect(). // If you want persistent connections change it to mysql_pconnect().
if ($config['mysqli']) { if ($config['mysqli']) {
if (empty($ssl)) { if (empty($ssl)) {
try {
$connect_id = mysqli_connect($host, $user, $pass, $db, $port); $connect_id = mysqli_connect($host, $user, $pass, $db, $port);
if (mysqli_connect_errno() > 0) { if (mysqli_connect_errno() > 0) {
include 'general/mysqlerr.php'; include 'general/mysqlerr.php';
return false; return false;
} }
} catch (\mysqli_sql_exception $e) {
include 'general/mysqlerr.php';
return false;
}
db_change_cache_id($db, $host); db_change_cache_id($db, $host);