refactor: Added config option for database port (#5517)

This commit is contained in:
David Bell
2017-01-27 23:16:04 +00:00
committed by Neil Lathwood
parent 46003a39b6
commit 5dd030f438
10 changed files with 23 additions and 17 deletions

View File

@@ -437,7 +437,7 @@ class IRCBot
private function chkdb()
{
if (!is_resource($this->sql)) {
if (($this->sql = mysqli_connect($this->config['db_host'], $this->config['db_user'], $this->config['db_pass'])) != false && mysqli_select_db($this->sql, $this->config['db_name'])) {
if (($this->sql = mysqli_connect($this->config['db_host'], $this->config['db_user'], $this->config['db_pass'], null, $this->config['db_port'])) != false && mysqli_select_db($this->sql, $this->config['db_name'])) {
return true;
} else {
$this->log('Cannot connect to MySQL');