summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRick Ellis <rick.ellis@ellislab.com>2008-10-17 06:18:04 +0200
committerRick Ellis <rick.ellis@ellislab.com>2008-10-17 06:18:04 +0200
commitcba158c75954079e593732f8479563d4dfb6ecb3 (patch)
treeeb6e5df4b8532edc819ab0c6e8c829207e35419b
parent12abaeb8f1771beb5858bf071d8fd576b5eb2c9b (diff)
Added brackets around database name in MS SQL driver when selecting the database, in the event that reserved characters are used in the name (bug report: 4915)
-rw-r--r--system/database/drivers/mssql/mssql_driver.php4
1 files changed, 3 insertions, 1 deletions
diff --git a/system/database/drivers/mssql/mssql_driver.php b/system/database/drivers/mssql/mssql_driver.php
index fbc0701c0..6130bf4cb 100644
--- a/system/database/drivers/mssql/mssql_driver.php
+++ b/system/database/drivers/mssql/mssql_driver.php
@@ -76,7 +76,9 @@ class CI_DB_mssql_driver extends CI_DB {
*/
function db_select()
{
- return @mssql_select_db($this->database, $this->conn_id);
+ // Note: The brackets are required in the event that the DB name
+ // contains reserved characters
+ return @mssql_select_db('['.$this->database.']', $this->conn_id);
}
// --------------------------------------------------------------------