diff options
author | Rick Ellis <rick.ellis@ellislab.com> | 2008-10-17 06:18:04 +0200 |
---|---|---|
committer | Rick Ellis <rick.ellis@ellislab.com> | 2008-10-17 06:18:04 +0200 |
commit | cba158c75954079e593732f8479563d4dfb6ecb3 (patch) | |
tree | eb6e5df4b8532edc819ab0c6e8c829207e35419b /system/database/drivers | |
parent | 12abaeb8f1771beb5858bf071d8fd576b5eb2c9b (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)
Diffstat (limited to 'system/database/drivers')
-rw-r--r-- | system/database/drivers/mssql/mssql_driver.php | 4 |
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);
}
// --------------------------------------------------------------------
|