From ffeeac3173aaf364f083ae7a5ec27940e7b6e5bd Mon Sep 17 00:00:00 2001 From: Martin Ambrus Date: Fri, 17 Nov 2017 22:48:43 +0100 Subject: [PATCH] fix: database connection does not include port from config #353 --- GameEngine/Admin/database.php | 2 +- GameEngine/Database.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/GameEngine/Admin/database.php b/GameEngine/Admin/database.php index be828ecd..95af5f15 100755 --- a/GameEngine/Admin/database.php +++ b/GameEngine/Admin/database.php @@ -48,7 +48,7 @@ class adm_DB { var $connection; function __construct(){ global $database; - $database = new MYSQLi_DB(SQL_SERVER, SQL_USER, SQL_PASS, SQL_DB); + $database = new MYSQLi_DB(SQL_SERVER.':'.SQL_PORT, SQL_USER, SQL_PASS, SQL_DB); $this->connection = $database->return_link(); } diff --git a/GameEngine/Database.php b/GameEngine/Database.php index 881022f4..56fd44a3 100755 --- a/GameEngine/Database.php +++ b/GameEngine/Database.php @@ -432,7 +432,7 @@ class MYSQLi_DB implements IDbConnection { */ public function connect() { // try to connect - $this->dblink = mysqli_connect($this->hostname, $this->username, $this->password); + $this->dblink = mysqli_connect($this->hostname.':'.$this->port, $this->username, $this->password); // return on error if (mysqli_error($this->dblink)) {