Skip to content

Commit

Permalink
database: report connection failure in _mysql_connect()
Browse files Browse the repository at this point in the history
This is used in the upgrade script and some old web pages.
You need to check $mysql->connect_errno after doing new mysqli
  • Loading branch information
davidpanderson committed Aug 16, 2024
1 parent d8fe23b commit 7fb55d6
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions html/inc/db.inc
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 7fb55d6

Please sign in to comment.