Re: Mixing of GROUP columns (MIN(),MAX(),COUNT(),...) with no GROUP columns is illegal if there is no GROUP BY clause
solved with 'counterCache' => TRUE
El jueves, 4 de octubre de 2012 01:39:51 UTC+2, Juan Ezquerro LLanes escribió:
I read http://book.cakephp.org/--2.0/en/core-libraries/ behaviors/containable.html# using-containable Where say:"ContainableBehavior can sometimes cause issues with other behaviors or queries that use aggregate functions and/or GROUP BY statements. If you get invalid SQL errors due to mixing of aggregate and non-aggregate fields, try disabling the autoFields setting.:<?php$this->Post->Behaviors->attach('Containable', array('autoFields' => false));" But i do:$this->AllowedDomain->Behaviors->load('Containable', array('autoFields' => false)); $this->paginate = array('conditions' => array('AllowedDomain.client_id' => $this->Session->read('Auth. User.Client.id ')),'fields' => array('id', 'domain'),'contain' => array('SecureScan' => array('fields' => 'COUNT(id) AS urls')));And always crash, can help please?
Like Us on FacekBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP
---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com.
To unsubscribe from this group, send email to cake-php+unsubscribe@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home