summaryrefslogtreecommitdiffstats
path: root/system/database/drivers/mysql/mysql_driver.php
diff options
context:
space:
mode:
Diffstat (limited to 'system/database/drivers/mysql/mysql_driver.php')
-rw-r--r--system/database/drivers/mysql/mysql_driver.php10
1 files changed, 10 insertions, 0 deletions
diff --git a/system/database/drivers/mysql/mysql_driver.php b/system/database/drivers/mysql/mysql_driver.php
index 34b6012cd..e0a1cee7d 100644
--- a/system/database/drivers/mysql/mysql_driver.php
+++ b/system/database/drivers/mysql/mysql_driver.php
@@ -58,6 +58,11 @@ class CI_DB_mysql_driver extends CI_DB {
*/
function db_connect()
{
+ if ($this->port != '')
+ {
+ $this->hostname .= ':'.$this->port;
+ }
+
return @mysql_connect($this->hostname, $this->username, $this->password, TRUE);
}
@@ -71,6 +76,11 @@ class CI_DB_mysql_driver extends CI_DB {
*/
function db_pconnect()
{
+ if ($this->port != '')
+ {
+ $this->hostname .= ':'.$this->port;
+ }
+
return @mysql_pconnect($this->hostname, $this->username, $this->password);
}