summaryrefslogtreecommitdiffstats
path: root/system/database
diff options
context:
space:
mode:
Diffstat (limited to 'system/database')
-rw-r--r--system/database/drivers/mysqli/mysqli_driver.php10
1 files changed, 9 insertions, 1 deletions
diff --git a/system/database/drivers/mysqli/mysqli_driver.php b/system/database/drivers/mysqli/mysqli_driver.php
index 4bbe5ebf6..f72db64b6 100644
--- a/system/database/drivers/mysqli/mysqli_driver.php
+++ b/system/database/drivers/mysqli/mysqli_driver.php
@@ -60,7 +60,15 @@ class CI_DB_mysqli_driver extends CI_DB {
*/
function db_connect()
{
- return @mysqli_connect($this->hostname, $this->username, $this->password, $this->database, $this->port);
+ if ($this->port != '')
+ {
+ return @mysqli_connect($this->hostname, $this->username, $this->password, $this->database, $this->port);
+ }
+ else
+ {
+ return @mysqli_connect($this->hostname, $this->username, $this->password, $this->database);
+ }
+
}
// --------------------------------------------------------------------