You can't define the same key twice in an array - 'AND' in your case.

Try this:

'conditions' => array(
  'or' => array(
    array(
      'ceg_id' => 0, 'osztaly_id' => $osztalyok
    ),
    array(
      'ceg_id' => 1, 'osztaly_id' => 0
    )
  )
)

hth
grigri

On Nov 27, 5:19 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:
> Hari,
>
> I need the following SQL query but can't get it by the array syntax.
> SELECT * FROM table
> WHERE (
>    (ceg_id = 0 AND osztaly_id IN(1,2))
>    OR
>    (ceg_id = 1 AND osztaly_id = 0)
> )
>
> I tried many different forms like this for find('all')
> 'conditions' => array(
>    'szamla_id' => $szamlaId,
>    'AND' => array(
>       'OR' => array(
>          'AND' => array(
>             'ceg_id' => 0,
>             'osztaly_id' => $osztalyok
>           ),
>          'AND' => array(
>             'ceg_id' => 1,
>             'osztaly_id' => 0
>          )
>       )
>    )

On Nov 27, 5:19 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:
> Hari,
>
> I need the following SQL query but can't get it by the array syntax.
> SELECT * FROM table
> WHERE (
>    (ceg_id = 0 AND osztaly_id IN(1,2))
>    OR
>    (ceg_id = 1 AND osztaly_id = 0)
> )
>
> I tried many different forms like this for find('all')
> 'conditions' => array(
>    'szamla_id' => $szamlaId,
>    'AND' => array(
>       'OR' => array(
>          'AND' => array(
>             'ceg_id' => 0,
>             'osztaly_id' => $osztalyok
>           ),
>          'AND' => array(
>             'ceg_id' => 1,
>             'osztaly_id' => 0
>          )
>       )
>    )
--~--~---------~--~----~------------~-------~--~----~
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