diff options
Diffstat (limited to 'system/database/drivers/odbc')
-rw-r--r-- | system/database/drivers/odbc/odbc_driver.php | 24 |
1 files changed, 8 insertions, 16 deletions
diff --git a/system/database/drivers/odbc/odbc_driver.php b/system/database/drivers/odbc/odbc_driver.php index 901787ff3..ed901bd81 100644 --- a/system/database/drivers/odbc/odbc_driver.php +++ b/system/database/drivers/odbc/odbc_driver.php @@ -57,12 +57,17 @@ class CI_DB_odbc_driver extends CI_DB { protected $_count_string = 'SELECT COUNT(*) AS '; protected $_random_keyword; - public function __construct($params) { 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; + } } /** @@ -72,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); } // -------------------------------------------------------------------- @@ -84,20 +89,7 @@ class CI_DB_odbc_driver extends CI_DB { */ public function db_pconnect() { - return @odbc_pconnect($this->hostname, $this->username, $this->password); - } - - // -------------------------------------------------------------------- - - /** - * Select the database - * - * @return resource - */ - public function db_select() - { - // Not needed for ODBC - return TRUE; + return @odbc_pconnect($this->dsn, $this->username, $this->password); } // -------------------------------------------------------------------- |