On 1 Jan 2010, at 12:56, engine wrote:
>
> I am putting this in straight forward and simple manner
>
> How to get the number of rows that corresponds to number of ids in a single
> $this->Model->find() query
>
> i mean i have one array of ids say
> $list = array('0 => 125, 2 => 145, 3 => 458, ......so one) the second
> parameter in this array is id from model table how can i fetch all of them
> in single find query. I have tried to use OR condition but that doesnt allow
> me to enter above array.
i would hazard you just need
array(
"Model.id" => $list
)
where $list is your array.
look at
http://book.cakephp.org/view/74/Complex-Find-Conditions
which should help.
--
Mike Karthäuser
Managing Director - Brightstorm Ltd
Email: [email protected]
Web: http://www.brightstorm.co.uk
Tel: 07939 252144
Address: 1 Brewery Court, North Street, Bristol, BS3 1JS
Check out the new CakePHP Questions site http://cakeqs.org and help others with
their CakePHP related questions.
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