Fix: mysqli works on localhost
This commit is contained in:
parent
d7a8e44db5
commit
93ee75291d
@ -231,8 +231,9 @@ class DoliDb
|
||||
{
|
||||
dolibarr_syslog("DoliDB::connect host=$host, port=$port, login=$login, passwd=--hidden--, name=$name",LOG_DEBUG);
|
||||
|
||||
// With mysql, port must be in hostname
|
||||
$newhost=$host;
|
||||
|
||||
// With mysql, port must be in hostname
|
||||
if ($port) $newhost.=':'.$port;
|
||||
|
||||
$this->db = @mysql_connect($newhost, $login, $passwd);
|
||||
|
||||
@ -233,8 +233,10 @@ class DoliDb
|
||||
{
|
||||
dolibarr_syslog("DoliDB::connect host=$host, port=$port, login=$login, passwd=--hidden--, name=$name");
|
||||
|
||||
// With mysqli, port must be in connect parameters
|
||||
$newhost=$host;
|
||||
$newport=$port;
|
||||
|
||||
// With mysqli, port must be in connect parameters
|
||||
if (! $newport) $newport=3306;
|
||||
|
||||
$this->db = @mysqli_connect($newhost, $login, $passwd, $name, $newport);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user