1
0
mirror of https://github.com/vrana/adminer.git synced 2025-08-13 18:14:07 +02:00

Return Db from connection()

It's not a real type declaration because compile.php passes stdClass here.
This commit is contained in:
Jakub Vrana
2025-03-30 08:18:25 +02:00
parent 7ee6f4f7ac
commit a93e4cb694
8 changed files with 29 additions and 32 deletions

View File

@@ -55,7 +55,7 @@ if (!$error && $_POST) {
$offset = 0;
$empty = true;
$connection2 = connect(adminer()->credentials()); // connection for exploring indexes and EXPLAIN (to not replace FOUND_ROWS()) //! PDO - silent error
if (is_object($connection2) && DB != "") {
if ($connection2 && DB != "") {
$connection2->select_db(DB);
if ($_GET["ns"] != "") {
set_schema($_GET["ns"], $connection2);
@@ -126,7 +126,7 @@ if (!$error && $_POST) {
}
$start = microtime(true);
//! don't allow changing of character_set_results, convert encoding of displayed query
if (connection()->multi_query($q) && is_object($connection2) && preg_match("~^$space*+USE\\b~i", $q)) {
if (connection()->multi_query($q) && $connection2 && preg_match("~^$space*+USE\\b~i", $q)) {
$connection2->query($q);
}