Welcome Guest, Not a member yet? Register   Sign In
Resetting active record 'group_by'

[eluser]Daniel H[/eluser]
For a particular reason, I use a common field filtering function to run my GET and COUNT statements. To cut a long story short, one of these common filtering statements contains a GROUP BY line, which obviously doesn't work when a COUNT is performed.

So is there a way to reset the GROUP BY to nothing after it has been set?



[eluser]Daniel H[/eluser]
Ignore this. I just use this:

$this->db->ar_groupby = array();

[eluser]Jon L[/eluser]
doesn't starting a new query reset it already?

[eluser]Daniel H[/eluser]
It would do yes, but I'm trying to using the same filters for my GET as my COUNT in the spirit of DRY.

[eluser]Jon L[/eluser]
in that case, using start_cache, stop_cache, flush_cache, etc, may suit your needs.

could start_cache, build query, stop_cache, count, change params, execute, flush_cache

Theme © iAndrew 2016 - Forum software by © MyBB