I have a problem with a findAll() query. The code is:

                $items = $this->Abc->findAll(array(
                        'Abc.users_id' => $this->Session->read('User.id'),
                        'Abc.focus' => ">= 3",
                        'Abc.focus' => "<= 3"
                ), null, 'startdate ASC');


What I want is to find those items which have focus = 3. But the code
above finds items which have focus <= 3.

You may wonder why I don't not just use: 'Abc.focus' => "3"?

Because this is part of a function:

function aaa($focus_low, $focus_high)
{
    $items = $this->Abc->findAll(array(
            'Abc.users_id' => $this->Session->read('User.id'),
            'Abc.focus' => ">= ".$focus_low,
            'Abc.focus' => "<= ".$focus_high
        ), null, 'startdate ASC');
}

So in some cases when I call this function i may want to find items
higher than or equal to 1 AND lower than or equal to 3. But in other
cases, like the above, i just want items which are equal to 3.

Thanks!


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

Reply via email to