Commit 8cbfefe0 authored by Marco Pivetta's avatar Marco Pivetta

Merge pull request #629 from mikeSimonson/patch-1

Allow to connect without a dbname param
parents 5eb36c7a 387eb545
......@@ -51,6 +51,7 @@ class MysqliConnection implements Connection, PingableConnection, ServerInfoAwar
{
$port = isset($params['port']) ? $params['port'] : ini_get('mysqli.default_port');
$socket = isset($params['unix_socket']) ? $params['unix_socket'] : ini_get('mysqli.default_socket');
$dbname = isset($params['dbname']) ? $params['dbname'] : null;
$flags = isset($driverOptions[static::OPTION_FLAGS]) ? $driverOptions[static::OPTION_FLAGS] : null;
......@@ -61,7 +62,7 @@ class MysqliConnection implements Connection, PingableConnection, ServerInfoAwar
$previousHandler = set_error_handler(function () {
});
if ( ! $this->_conn->real_connect($params['host'], $username, $password, $params['dbname'], $port, $socket, $flags)) {
if ( ! $this->_conn->real_connect($params['host'], $username, $password, $dbname, $port, $socket, $flags)) {
set_error_handler($previousHandler);
$sqlState = 'HY000';
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment