Skip to content

Commit

Permalink
Update DB_query_builder.php
Browse files Browse the repository at this point in the history
recent changes broke query ordering giving a warning in line 1238 = '$this->qb_cache_orderby = array_merge($this->qb_cache_orderby, $qb_orderby);'
this was because on subsequent re-queries, the qb_cache_orderby was set to NULL not Array() as it is should be (and is instantiated originally .
  • Loading branch information
pgee70 committed Oct 2, 2017
1 parent c495515 commit cf3924e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion system/database/DB_query_builder.php
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit cf3924e

Please sign in to comment.