// 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:
@@ -35,7 +35,13 @@ class DbMySQLiCore extends Db
|
||||
*/
|
||||
public function connect()
|
||||
{
|
||||
$this->link = @new mysqli($this->server, $this->user, $this->password, $this->database);
|
||||
if (strpos($this->server, ':') !== false)
|
||||
{
|
||||
list($server, $port) = explode(':', $this->server);
|
||||
$this->link = @new mysqli($server, $this->user, $this->password, $this->database, $port);
|
||||
}
|
||||
else
|
||||
$this->link = @new mysqli($this->server, $this->user, $this->password, $this->database);
|
||||
|
||||
// Do not use object way for error because this work bad before PHP 5.2.9
|
||||
if (mysqli_connect_error())
|
||||
|
||||
Reference in New Issue
Block a user