Home N-13 News Forums Help Search
RegisterForgot password?
Login with facebook , twitter and google account aningbo
I have the following error at the top of the page how to fix it Rayc

Latest N-13 News 4.0.2

What is N-13 News?
Where can I get help?

Forums Tutorials CakePHP - Find method using IN clause
Chris
Posted on 13 Jan 2012, 03:38:47

Access: Admin
Total Posts: 1349
Joined: 2006-05-19

SELECT * FROM table WHERE id IN (1,2,3,4,5)

The above query can be converted to CakePHP like so

<?php
$ids = array(1,2,3,4,5);
$this->Model->find('all', array(
    'conditions' => array('Model.id' => $ids)
));

Piece of cake eh?

#3683
Last edited by Chris at 2012-01-13 06:45:12 Reason: .
Network-13.com © 2011