Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PHP 8 upgrade #74

Merged
merged 18 commits into from
Dec 27, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions libs/db_lib/mysqli.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ function connect($db_host, $db_username, $db_password, $db_name = NULL, $use_nam

if ($this->link_id){
if (!empty($use_names)) $this->query("SET NAMES '$use_names'");
} else die($lang_global['err_sql_conn_db']);
} else die($lang_global['err_sql_conn_db'] . " DB: {$db_name}");
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added this to make it more clear which database is failing, since the default error language does not make it obvious, and there's several potential culprits

}

function db($db_name) {
Expand Down Expand Up @@ -118,11 +118,11 @@ function close(){
global $tot_queries;
$tot_queries += $this->num_queries;
if ($this->link_id){
if ($this->query_result) @mysqli_free_result($this->query_result);
return @mysqli_close($this->link_id);
if ($this->query_result instanceof mysqli_result) mysqli_free_result($this->query_result);
return mysqli_close($this->link_id);
} else return false;
}

function start_transaction(){
return;
}
Expand All @@ -131,4 +131,8 @@ function end_transaction(){
return;
}
}
?>
?>