mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 06:08:52 +00:00
- fix for a php bug (not able to connect on custom ports if the server is localhost - though 127.0.0.1 works) -> #1444
git-svn-id: file:///svn/phpbb/trunk@5774 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
parent
1e0ee65aed
commit
a2ac7a6cc6
1 changed files with 12 additions and 2 deletions
|
@ -39,10 +39,12 @@ class dbal_mysqli extends dbal
|
||||||
{
|
{
|
||||||
$this->persistency = $persistency;
|
$this->persistency = $persistency;
|
||||||
$this->user = $sqluser;
|
$this->user = $sqluser;
|
||||||
$this->server = $sqlserver . (($port) ? ':' . $port : '');
|
$this->server = $sqlserver;
|
||||||
$this->dbname = $database;
|
$this->dbname = $database;
|
||||||
|
$port = (!$port) ? NULL : $port;
|
||||||
|
|
||||||
$this->db_connect_id = ($this->persistency) ? @mysqli_pconnect($this->server, $this->user, $sqlpassword) : @mysqli_connect($this->server, $this->user, $sqlpassword);
|
// Persistant connections not supported by the mysqli extension?
|
||||||
|
$this->db_connect_id = @mysqli_connect($this->server, $this->user, $sqlpassword, $this->dbname, $port);
|
||||||
|
|
||||||
if ($this->db_connect_id && $this->dbname != '')
|
if ($this->db_connect_id && $this->dbname != '')
|
||||||
{
|
{
|
||||||
|
@ -289,6 +291,14 @@ class dbal_mysqli extends dbal
|
||||||
*/
|
*/
|
||||||
function _sql_error()
|
function _sql_error()
|
||||||
{
|
{
|
||||||
|
if (!$this->db_connect_id)
|
||||||
|
{
|
||||||
|
return array(
|
||||||
|
'message' => @mysqli_connect_error(),
|
||||||
|
'code' => @mysqli_connect_errno()
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
return array(
|
return array(
|
||||||
'message' => @mysqli_error($this->db_connect_id),
|
'message' => @mysqli_error($this->db_connect_id),
|
||||||
'code' => @mysqli_errno($this->db_connect_id)
|
'code' => @mysqli_errno($this->db_connect_id)
|
||||||
|
|
Loading…
Add table
Reference in a new issue