简体   繁体   中英

where in clause and query multiple IDs using FuelPHP

Model_Article::query()->where('id', 4);

I'm using FuelPHP. I have query like the above.

And I have an arrays of ID's

$ids = array(1, 2, 4, 8 ...);

How do I apply my array of id's to write this query using that format?

Thanks a lot!

->where()内部'IN'以创建一个IN()子句:

Model_Article::query()->where('field_name', 'IN', array(1,2,3,4,5))->get();

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM