diff --git a/model/MySQLDatabase.php b/model/MySQLDatabase.php index e85f26123..597532a4b 100644 --- a/model/MySQLDatabase.php +++ b/model/MySQLDatabase.php @@ -54,7 +54,12 @@ class MySQLDatabase extends SS_Database { * - timezone: (optional) The timezone offset. For example: +12:00, "Pacific/Auckland", or "SYSTEM" */ public function __construct($parameters) { - $this->dbConn = new MySQLi($parameters['server'], $parameters['username'], $parameters['password']); + if(!empty($parameters['port'])) { + $this->dbConn = new MySQLi($parameters['server'], $parameters['username'], $parameters['password'], + '', $parameters['port']); + } else { + $this->dbConn = new MySQLi($parameters['server'], $parameters['username'], $parameters['password']); + } if($this->dbConn->connect_error) { $this->databaseError("Couldn't connect to MySQL database | " . $this->dbConn->connect_error);