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

[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?

Thanks,

Dan.
#2

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

Code:
$this->db->ar_groupby = array();
#3

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

[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.
#5

[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