summaryrefslogtreecommitdiffstats
path: root/system/database
diff options
context:
space:
mode:
authorAndrey Andreev <narf@bofh.bg>2012-02-13 00:39:53 +0100
committerAndrey Andreev <narf@bofh.bg>2012-02-13 00:39:53 +0100
commit46f6dbc6a60e37ad1b88458f8cdfd3e1d1d94f5e (patch)
treed5693afb1b8c77bbdb850533a52db3b4e9c51cfc /system/database
parent47489fbbb38b85584adf34032c4a88477713ddd4 (diff)
Added DSN string support
Diffstat (limited to 'system/database')
-rw-r--r--system/database/drivers/odbc/odbc_driver.php10
1 files changed, 8 insertions, 2 deletions
diff --git a/system/database/drivers/odbc/odbc_driver.php b/system/database/drivers/odbc/odbc_driver.php
index a674c390e..c9aaa6e68 100644
--- a/system/database/drivers/odbc/odbc_driver.php
+++ b/system/database/drivers/odbc/odbc_driver.php
@@ -62,6 +62,12 @@ class CI_DB_odbc_driver extends CI_DB {
parent::__construct($params);
$this->_random_keyword = ' RND('.time().')'; // database specific random keyword
+
+ // Legacy support for DSN in the hostname field
+ if ($this->dsn == '')
+ {
+ $this->dsn = $this->hostname;
+ }
}
/**
@@ -71,7 +77,7 @@ class CI_DB_odbc_driver extends CI_DB {
*/
public function db_connect()
{
- return @odbc_connect($this->hostname, $this->username, $this->password);
+ return @odbc_connect($this->dsn, $this->username, $this->password);
}
// --------------------------------------------------------------------
@@ -83,7 +89,7 @@ class CI_DB_odbc_driver extends CI_DB {
*/
public function db_pconnect()
{
- return @odbc_pconnect($this->hostname, $this->username, $this->password);
+ return @odbc_pconnect($this->dsn, $this->username, $this->password);
}
// --------------------------------------------------------------------