summaryrefslogtreecommitdiffstats
path: root/system/database/drivers/mssql/mssql_driver.php
diff options
context:
space:
mode:
authorAndrey Andreev <narf@bofh.bg>2012-02-24 10:40:36 +0100
committerAndrey Andreev <narf@bofh.bg>2012-02-24 10:40:36 +0100
commit024ba2dffd49e26f68468acd69feebd685f63f68 (patch)
treea712da1957a5e7d1381e87ac77e6c47e884310d6 /system/database/drivers/mssql/mssql_driver.php
parent11454e039fd82f2fd4ee2f186ad0317e3435f187 (diff)
Update database property when switching to a new one
Diffstat (limited to 'system/database/drivers/mssql/mssql_driver.php')
-rw-r--r--system/database/drivers/mssql/mssql_driver.php13
1 files changed, 12 insertions, 1 deletions
diff --git a/system/database/drivers/mssql/mssql_driver.php b/system/database/drivers/mssql/mssql_driver.php
index 27b492f96..25a32f364 100644
--- a/system/database/drivers/mssql/mssql_driver.php
+++ b/system/database/drivers/mssql/mssql_driver.php
@@ -119,9 +119,20 @@ class CI_DB_mssql_driver extends CI_DB {
*/
public function db_select($database = '')
{
+ if ($database === '')
+ {
+ $database = $this->database;
+ }
+
// Note: The brackets are required in the event that the DB name
// contains reserved characters
- return @mssql_select_db('['.($database == '' ? $this->database : $database).']', $this->conn_id);
+ if (@mssql_select_db('['.$database.']', $this->conn_id))
+ {
+ $this->database = $database;
+ return TRUE;
+ }
+
+ return FALSE;
}
// --------------------------------------------------------------------