Commit 3c6dbfce authored by Steve Müller's avatar Steve Müller

Merge pull request #712 from mikeSimonson/fix-dbname-mysqli

Backporting a fix to allow connection without dbname
parents 81591fd4 4ae4b93d
...@@ -43,9 +43,10 @@ class MysqliConnection implements Connection ...@@ -43,9 +43,10 @@ class MysqliConnection implements Connection
{ {
$port = isset($params['port']) ? $params['port'] : ini_get('mysqli.default_port'); $port = isset($params['port']) ? $params['port'] : ini_get('mysqli.default_port');
$socket = isset($params['unix_socket']) ? $params['unix_socket'] : ini_get('mysqli.default_socket'); $socket = isset($params['unix_socket']) ? $params['unix_socket'] : ini_get('mysqli.default_socket');
$dbname = isset($params['dbname']) ? $params['dbname'] : null;
$this->_conn = mysqli_init(); $this->_conn = mysqli_init();
if ( ! $this->_conn->real_connect($params['host'], $username, $password, $params['dbname'], $port, $socket)) { if ( ! $this->_conn->real_connect($params['host'], $username, $password, $dbname, $port, $socket)) {
throw new MysqliException($this->_conn->connect_error, $this->_conn->connect_errno); throw new MysqliException($this->_conn->connect_error, $this->_conn->connect_errno);
} }
......
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