summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--system/database/drivers/pdo/pdo_driver.php5
1 files changed, 4 insertions, 1 deletions
diff --git a/system/database/drivers/pdo/pdo_driver.php b/system/database/drivers/pdo/pdo_driver.php
index c5940ddc8..8516cc6fe 100644
--- a/system/database/drivers/pdo/pdo_driver.php
+++ b/system/database/drivers/pdo/pdo_driver.php
@@ -121,7 +121,10 @@ class CI_DB_pdo_driver extends CI_DB {
// End dsn with a semicolon for extra backward compability
// if database property was not empty.
- $this->dsn .= rtrim($this->hostname, ';').';';
+ if( ! empty($this->database))
+ {
+ $this->dsn .= rtrim($this->hostname, ';').';';
+ }
}
else
{