diff --git a/adminer/drivers/mongo.inc.php b/adminer/drivers/mongo.inc.php index ebacdc1f..2029f08b 100644 --- a/adminer/drivers/mongo.inc.php +++ b/adminer/drivers/mongo.inc.php @@ -328,9 +328,9 @@ if (isset($_GET["mongo"])) { $limit = min(200, max(1, (int) $limit)); $skip = $page * $limit; try { - return new Result($this->_conn->_link->executeQuery("$connection->_db_name.$table", new \MongoDB\Driver\Query($where, array('projection' => $select, 'limit' => $limit, 'skip' => $skip, 'sort' => $sort)))); + return new Result($this->_conn->_link->executeQuery($this->_conn->_db_name . ".$table", new \MongoDB\Driver\Query($where, array('projection' => $select, 'limit' => $limit, 'skip' => $skip, 'sort' => $sort)))); } catch (Exception $e) { - $connection->error = $e->getMessage(); + $this->_conn->error = $e->getMessage(); return false; } } diff --git a/adminer/include/functions.inc.php b/adminer/include/functions.inc.php index e8bedb07..070bfe64 100644 --- a/adminer/include/functions.inc.php +++ b/adminer/include/functions.inc.php @@ -1311,6 +1311,7 @@ function slow_query($query) { $db = $adminer->database(); $timeout = $adminer->queryTimeout(); $slow_query = $driver->slowQuery($query, $timeout); + $connection2 = null; if (!$slow_query && support("kill") && is_object($connection2 = connect($adminer->credentials())) && ($db == "" || $connection2->select_db($db))) { $kill = $connection2->result(connection_id()); // MySQL and MySQLi can use thread_id but it's not in PDO_MySQL ?> @@ -1321,8 +1322,6 @@ var timeout = setTimeout(function () { }, );