diff options
author | Andrey Andreev <narf@bofh.bg> | 2012-03-02 12:49:28 +0100 |
---|---|---|
committer | Andrey Andreev <narf@bofh.bg> | 2012-03-02 12:49:28 +0100 |
commit | a0c2785f91bc70fb4a0a02f1c9c28cb99c975457 (patch) | |
tree | 07c3ba4d73ca82ead86e75215f481fe4990ab76a /system/database/drivers | |
parent | c8b3ac4fa57fed397b6d1085f8ff99c25c7a9221 (diff) |
Change SQLite _execute() to use is_write_type()
Diffstat (limited to 'system/database/drivers')
-rw-r--r-- | system/database/drivers/sqlite/sqlite_driver.php | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/system/database/drivers/sqlite/sqlite_driver.php b/system/database/drivers/sqlite/sqlite_driver.php index 20b05af0d..8116cfb18 100644 --- a/system/database/drivers/sqlite/sqlite_driver.php +++ b/system/database/drivers/sqlite/sqlite_driver.php @@ -154,13 +154,9 @@ class CI_DB_sqlite_driver extends CI_DB { protected function _execute($sql) { $sql = $this->_prep_query($sql); - - if ( ! preg_match('/^(SELECT|EXPLAIN).+$/i', ltrim($sql))) - { - return @sqlite_exec($this->conn_id, $sql); - } - - return @sqlite_query($this->conn_id, $sql); + return $this->is_write_type($sql) + ? @sqlite_exec($this->conn_id, $sql) + : @sqlite_query($this->conn_id, $sql); } // -------------------------------------------------------------------- |