It looks to me like the second example will fail also. Note the added comma.
The proper way to deal with this should be to separate your conditions into an array. On Mon, Apr 14, 2008 at 3:01 PM, bingo <[EMAIL PROTECTED]> wrote: > > hi > > I just discovered that this condition in a query wont work > > //Example 1 > $condition['Model'][upper($field)] = "IF VALUE CONTAINS AND , THE > QUERY WONT WORK"; > $this->findAll($condition) > //generates this --> select * from model where upper(field) = "IF > VALUE CONTAINS" AND ", THE QUERY WONT WORK ". > > //Example 2 > $condition['Model'][lower($field)] = "if value contains and the query > wont work" > $this->findAll($condition); > //generates this -> select * from model where lower(field) = "if value > contains and , the query wont work" > > Example 1 generate wrong query where as example 2 generate right > query. The problem is with the word "and" in the value. > > Did anyone else faced similar problem. if so let me know how you > solved the problem > > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Cake PHP" 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 -~----------~----~----~----~------~----~------~--~---
