diff options
author | Andrey Andreev <narf@bofh.bg> | 2012-03-26 20:51:00 +0200 |
---|---|---|
committer | Andrey Andreev <narf@bofh.bg> | 2012-03-26 20:51:00 +0200 |
commit | 925d37391789405f53da73979305dead6a053099 (patch) | |
tree | 0ed90207fe66bb5491e8925d20d48c211a897cf8 /system/database/drivers/odbc/odbc_driver.php | |
parent | e6f7d610b189e243ad48dcc3900a5c53cab2498d (diff) | |
parent | 84c3b27fface58ecfcd0acf7172d3ee2043b3673 (diff) |
Merge branch 'develop' of github.com:EllisLab/CodeIgniter into develop-helpers-acc
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 |