diff options
author | Andrey Andreev <narf@bofh.bg> | 2012-10-12 12:03:29 +0200 |
---|---|---|
committer | Andrey Andreev <narf@bofh.bg> | 2012-10-12 12:03:29 +0200 |
commit | 0bcf590db467e4aeb755e79daaccd38c83fe2439 (patch) | |
tree | 4db5a33a020c76eca4d3c068b6bfb883669707de /system/database/DB_query_builder.php | |
parent | 13f5054a478ee52a9ef262216248337ef40d6677 (diff) |
Fix having(), group_by()
Diffstat (limited to 'system/database/DB_query_builder.php')
-rw-r--r-- | system/database/DB_query_builder.php | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/system/database/DB_query_builder.php b/system/database/DB_query_builder.php index ab04e4db2..ac8ff48a3 100644 --- a/system/database/DB_query_builder.php +++ b/system/database/DB_query_builder.php @@ -920,7 +920,7 @@ abstract class CI_DB_query_builder extends CI_DB_driver { * @param bool * @return object */ - public function having($key, $value = '', $escape = NULL) + public function having($key, $value = NULL, $escape = NULL) { return $this->_wh('qb_having', $key, $value, 'AND ', $escape); } @@ -937,7 +937,7 @@ abstract class CI_DB_query_builder extends CI_DB_driver { * @param bool * @return object */ - public function or_having($key, $value = '', $escape = NULL) + public function or_having($key, $value = NULL, $escape = NULL) { return $this->_wh('qb_having', $key, $value, 'OR ', $escape); } @@ -1812,7 +1812,7 @@ abstract class CI_DB_query_builder extends CI_DB_driver { * @param mixed the where clause * @param mixed the limit clause * @param bool - * @return object + * @return mixed */ public function delete($table = '', $where = '', $limit = NULL, $reset_data = TRUE) { @@ -2101,8 +2101,6 @@ abstract class CI_DB_query_builder extends CI_DB_driver { { if (count($this->qb_groupby) > 0) { - $sql = "\nGROUP BY "; - for ($i = 0, $c = count($this->qb_groupby); $i < $c; $i++) { $this->qb_groupby[$i] = ($this->qb_groupby[$i]['escape'] === FALSE) @@ -2110,7 +2108,7 @@ abstract class CI_DB_query_builder extends CI_DB_driver { : $this->protect_identifiers($this->qb_groupby[$i]['field']); } - $sql .= implode(', ', $this->qb_groupby); + return "\nGROUP BY ".implode(', ', $this->qb_groupby); } return ''; |