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

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

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