瀏覽代碼

only pass port to mysqli_connect when it is set

Andrew Dolgov 11 年之前
父節點
當前提交
b20b6af0dc
共有 1 個文件被更改,包括 4 次插入1 次删除
  1. 4 1
      classes/db/mysqli.php

+ 4 - 1
classes/db/mysqli.php

@@ -3,7 +3,10 @@ class Db_Mysqli implements IDb {
 	private $link;
 
 	function connect($host, $user, $pass, $db, $port) {
-		$this->link = mysqli_connect($host, $user, $pass, $db, $port);
+		if ($port)
+			$this->link = mysqli_connect($host, $user, $pass, $db, $port);
+		else
+			$this->link = mysqli_connect($host, $user, $pass, $db);
 
 		if ($this->link) {
 			$this->init();