• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
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


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.