No, the first one is the correct way; the manual is correct. You must be using an old version of cake.
This was changed a while ago to avoid SQL injection. On Dec 18, 12:24 pm, boyracerr <[email protected]> wrote: > I have now solved this; correct syntax is: > > $this->data['user_count'] = $userObj->findCount(array( > 'User.status' => '1', > 'User.id' => '>' . 18) > , 0); > > I believe this to be a fault in the documentation > athttp://book.cakephp.org/view/74/Complex-Find-Conditions- the fifth > example down will not work unless modified as above. > > On Dec 18, 12:46 am, boyracerr <[email protected]> wrote: > > > I'm trying to do a simple comparison search, and for some reason its > > giving me an error. I feel like I am missing something blindingly > > obvious, but the only thing that suggests itself at the moment is some > > sort of bug in the way that conditions are parsed. > > > Doing the following: > > > $this->data['user_count'] = $userObj->findCount(array( > > 'User.status' => '1', > > 'User.id >' => 18) > > , 0); > > > gives an SQL error, caused by this in the SQL: > > > `User`.`id` > = 18 > > > (the space between > and = is the problem) > > > Could anyone show me where I am going wrong? > > > Ben --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~----------~----~----~----~------~----~------~--~---
