diff options
author | Andrey Andreev <narf@bofh.bg> | 2012-03-09 13:17:18 +0100 |
---|---|---|
committer | Andrey Andreev <narf@bofh.bg> | 2012-03-09 13:17:18 +0100 |
commit | 5f2214f0526b823c92f308312d883147a4c9faed (patch) | |
tree | 146f821e4a7d60ee059764c2bc884620c9e84901 /system/database/drivers/postgre/postgre_driver.php | |
parent | 4cc726913b7a8696dc5cff7456b6a95926b6816b (diff) | |
parent | c016a1102e2a77e0c27b9656c19a0460df24dfb6 (diff) |
Merge upstream branch
Diffstat (limited to 'system/database/drivers/postgre/postgre_driver.php')
-rw-r--r-- | system/database/drivers/postgre/postgre_driver.php | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/system/database/drivers/postgre/postgre_driver.php b/system/database/drivers/postgre/postgre_driver.php index d8b43695c..133861f9f 100644 --- a/system/database/drivers/postgre/postgre_driver.php +++ b/system/database/drivers/postgre/postgre_driver.php @@ -412,7 +412,7 @@ class CI_DB_postgre_driver extends CI_DB { return 0; } - $query = $this->query($this->_count_string.$this->_protect_identifiers('numrows').' FROM '.$this->_protect_identifiers($table, TRUE, NULL, FALSE)); + $query = $this->query($this->_count_string.$this->protect_identifiers('numrows').' FROM '.$this->protect_identifiers($table, TRUE, NULL, FALSE)); if ($query->num_rows() == 0) { return 0; @@ -638,22 +638,20 @@ class CI_DB_postgre_driver extends CI_DB { * @param string the limit clause * @return string */ - protected function _delete($table, $where = array(), $like = array(), $limit = FALSE) + protected function _delete($table, $where = array(), $like = array()) { - $conditions = ''; - if (count($where) > 0 OR count($like) > 0) { - $conditions = "\nWHERE ".implode("\n", $this->ar_where); - - if (count($where) > 0 && count($like) > 0) - { - $conditions .= ' AND '; - } - $conditions .= implode("\n", $like); + $conditions = "\nWHERE ".implode("\n", $this->ar_where) + .((count($where) > 0 && count($like) > 0) ? ' AND ' : '') + .implode("\n", $like); + } + else + { + $conditions = ''; } - return 'DELETE FROM '.$table.$conditions.( ! $limit ? '' : ' LIMIT '.$limit); + return 'DELETE FROM '.$table.$conditions; } // -------------------------------------------------------------------- |