// Add support of different mysql port for mysqli and pdo
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@12930 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
+10
-1
@@ -39,7 +39,16 @@ class DbPDOCore extends Db
|
||||
{
|
||||
try
|
||||
{
|
||||
$this->link = new PDO('mysql:dbname='.$this->database.';host='.$this->server, $this->user, $this->password);
|
||||
$dsn = 'mysql:dbname='.$this->database;
|
||||
if (strpos($this->server, ':') !== false)
|
||||
{
|
||||
list($server, $port) = explode(':', $this->server);
|
||||
$dsn .= ';server='.$server.';port='.$port;
|
||||
}
|
||||
else
|
||||
$dsn .= ';server='.$this->server;
|
||||
|
||||
$this->link = new PDO($dsn, $this->user, $this->password);
|
||||
}
|
||||
catch (PDOException $e)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user