Solved thread

This post is marked as solved. If you think the information contained on this thread must be part of the official documentation, please contribute submitting a pull request to its repository.

Multi conditions query

Hello, I have an array that contains 'id'' 's of items that i need to pull from my database. Is it possible to set that array for my find() conditions or something like that? I need to get data of that items from array.

Thx



66.0k
Accepted
answer

Are you talking about IN clause?

$robots = Robots::find([
    'id IN ({ids:array})',
    'bind' => [
        'ids' => [1, 2, 3, 4, 5]
    ]
]);

More info here: https://docs.phalconphp.com/en/latest/reference/models.html#binding-parameters scroll little further after first two code sections;



9.4k

Are you talking about IN clause?

```php $robots = Robots::find([ 'id IN ({ids:array})', 'bind' => [ 'ids' => [1, 2, 3, 4, 5] ] ]); ```

More info here: https://docs.phalconphp.com/en/latest/reference/models.html#binding-parameters scroll little further after first two code sections;

Thanks friend, I was searching in docs but obviously not a nuff :D