database: report connection failure in _mysql_connect()

This is used in the upgrade script and some old web pages.
You need to check $mysql->connect_errno after doing new mysqli
This commit is contained in:
David Anderson 2024-08-15 23:06:59 -07:00
parent d8fe23b3c2
commit 7fb55d67a8
1 changed files with 3 additions and 0 deletions

View File

@ -48,6 +48,9 @@ if (MYSQLI) {
$port = null;
}
$mysqli = @new mysqli($host, $user, $pass, $dbname, $port);
if ($mysqli->connect_errno) {
return null;
}
return $mysqli;
}
function _mysql_query($q) {