Your order statement is incorrect. Try this instead:
array('order' => array('monthly_cost ASC'))
Jeremy Burns
Class Outfit
[email protected]
http://www.classoutfit.com
On 21 Jan 2011, at 08:34, OldWest wrote:
> I am continuing to get an SQL error, and my query is NOT working???
> Warning (512): SQL Error: 1064: You have an error in your SQL syntax; check
> the manual that corresponds to your MySQL server version for the right syntax
> to use near 'order = ('asc') AND conditions = (1)' at line 1
>
> Here is my code:
>
> Plan Controller Method search()
>
> function search() {
> $this->Plan->recursive = 2; //*** Modified by Jason: Recursion
> needs to be corrected with better method. ***//
> $active = $this->Plan->getActive();
> $this->set('plans', $this->paginate());
> } // Trying to get $active to return to my results, but nothing is
> happening at all except the above error and ALL results (query is not
> effective).
>
> Plan Model Method search()
>
> function getActive() {
> $conditions = array(
> 'limit' => 10,
> 'order' => array('monthly_cost' => 'asc'),
> 'conditions' => array('PlanDetail.active' => 1) // Gets all active=1
> plan_details.
> );
> return $this->find('all', compact('conditions'));
> }
>
> Anyone know why this is not working?
>
>
> --
> Our newest site for the community: CakePHP Video Tutorials
> http://tv.cakephp.org
> Check out the new CakePHP Questions site http://ask.cakephp.org and help
> others with their CakePHP related questions.
>
>
> To unsubscribe from this group, send email to
> [email protected] For more options, visit this group at
> http://groups.google.com/group/cake-php
--
Our newest site for the community: CakePHP Video Tutorials
http://tv.cakephp.org
Check out the new CakePHP Questions site http://ask.cakephp.org and help others
with their CakePHP related questions.
To unsubscribe from this group, send email to
[email protected] For more options, visit this group at
http://groups.google.com/group/cake-php