Skip to content
Snippets Groups Projects
Commit 93ee7529 authored by Laurent Destailleur's avatar Laurent Destailleur
Browse files

Fix: mysqli works on localhost

parent d7a8e44d
No related branches found
No related tags found
No related merge requests found
......@@ -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);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment