diff --git a/system/database/DB_query_builder.php b/system/database/DB_query_builder.php index 81603bf31f4..72bd4e72117 100644 --- a/system/database/DB_query_builder.php +++ b/system/database/DB_query_builder.php @@ -1405,7 +1405,7 @@ public function count_all_results($table = '', $reset = TRUE) // for selecting COUNT(*) ... $qb_orderby = $this->qb_orderby; $qb_cache_orderby = $this->qb_cache_orderby; - $this->qb_orderby = $this->qb_cache_orderby = NULL; + $this->qb_orderby = $this->qb_cache_orderby = array(); $result = ($this->qb_distinct === TRUE OR ! empty($this->qb_groupby) OR ! empty($this->qb_cache_groupby) OR $this->qb_limit OR $this->qb_offset) ? $this->query($this->_count_string.$this->protect_identifiers('numrows')."\nFROM (\n".$this->_compile_select()."\n) CI_count_all_results")