yeah - drop the AND - leave just 2 arrays
array('or' => array(array(), array()))

--
Marcin Domanski
http://kabturek.info



On Fri, Aug 29, 2008 at 1:22 PM, zpon <[EMAIL PROTECTED]> wrote:
>
> Oh, I see, any ideas of how to do it then?
>
> On 29 Aug., 12:33, "Dardo Sordi Bogado" <[EMAIL PROTECTED]> wrote:
>> You are redeclaring the 'AND' key, i.e:
>>
>> $a = array(
>> 'and' => 1,
>> 'and' => 2
>> );
>>
>> $a['and'] == 2
>>
>> On Fri, Aug 29, 2008 at 3:29 AM, zpon <[EMAIL PROTECTED]> wrote:
>>
>> > Hi
>>
>> > I am doing a nested AND in a OR, like this:
>>
>> > array('conditions' =>
>> >        array(
>> >                'OR' => array(
>> >                        'AND' => array(
>> >                                'ForloebElements.coach_id' => 
>> > $this->Session->read('user_id'),
>> >                                'ForloebElements.coach_betalt' => 0
>> >                        ),
>> >                        'AND' => array(
>> >                                'ForloebElements.coach2_id' => 
>> > $this->Session->read('user_id'),
>> >                                'ForloebElements.coach2_betalt' => 0
>> >                        )
>> >                )
>> >        )
>> > )
>>
>> > I was hoping for something like
>>
>> > "WHERE ((`ForloebElements`.`coach_id` = $this->Session-
>> >>read('user_id') AND `ForloebElements`.`coach_betalt` = 0) OR
>> > ((`ForloebElements`.`coach2_id` = $this->Session->read('user_id') AND
>> > `ForloebElements`.`coach2_betalt` = 0))"
>>
>> > but instead I get only the last part
>>
>> > "WHERE ((`ForloebElements`.`coach2_id` = 5) AND
>> > (`ForloebElements`.`coach2_betalt` = 0))"
>>
>> > What could be the problem?
> >
>

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to