diff options
author | Andrey Andreev <narf@bofh.bg> | 2012-03-26 21:49:09 +0200 |
---|---|---|
committer | Andrey Andreev <narf@bofh.bg> | 2012-03-26 21:49:09 +0200 |
commit | 3ea6b1fd8fb0492d84c4879e039d11713c9f39a5 (patch) | |
tree | 4d6dc4dea352630ab843104b365c44eda0e8526b /system/database/drivers/odbc/odbc_driver.php | |
parent | 160a4e5628aba8b5e35da784ec87037e133c1f05 (diff) | |
parent | e92df33e7dda139ee46bddca31aebb4cd5d452fd (diff) |
Merge branch 'develop' of github.com:EllisLab/CodeIgniter into develop-dh-date-range
Diffstat (limited to 'system/database/drivers/odbc/odbc_driver.php')
-rw-r--r-- | system/database/drivers/odbc/odbc_driver.php | 44 |
1 files changed, 9 insertions, 35 deletions
diff --git a/system/database/drivers/odbc/odbc_driver.php b/system/database/drivers/odbc/odbc_driver.php index cfa561c3d..ad773117f 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,22 +89,7 @@ class CI_DB_odbc_driver extends CI_DB { */ public function db_pconnect() { - return @odbc_pconnect($this->hostname, $this->username, $this->password); - } - - // -------------------------------------------------------------------- - - /** - * Reconnect - * - * Keep / reestablish the db connection if no queries have been - * sent for a length of time exceeding the server's idle timeout - * - * @return void - */ - public function reconnect() - { - // not implemented in odbc + return @odbc_pconnect($this->dsn, $this->username, $this->password); } // -------------------------------------------------------------------- @@ -125,28 +115,12 @@ class CI_DB_odbc_driver extends CI_DB { */ protected function _execute($sql) { - $sql = $this->_prep_query($sql); return @odbc_exec($this->conn_id, $sql); } // -------------------------------------------------------------------- /** - * Prep the query - * - * If needed, each database adapter can prep the query string - * - * @param string an SQL query - * @return string - */ - protected function _prep_query($sql) - { - return $sql; - } - - // -------------------------------------------------------------------- - - /** * Begin Transaction * * @return bool @@ -577,4 +551,4 @@ class CI_DB_odbc_driver extends CI_DB { } /* End of file odbc_driver.php */ -/* Location: ./system/database/drivers/odbc/odbc_driver.php */ +/* Location: ./system/database/drivers/odbc/odbc_driver.php */
\ No newline at end of file |