我爱占星网 我爱占星网
首页
编程
java
php
前端
首页 编程 java php 前端

where子句和使用FuelPHP查询多个ID

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!

Feed the 'IN' inside the ->where() to create an IN() clause:

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

近期文章

  • 无法使用php将数据插入数据库(mysql)
  • 我的PDO查询将无法正常运行并且失败
  • htaccess ErrorDocument与RewriteEngine冲突
  • Red5能够录制来自iPhone或iPad的音频吗?
  • 使用curl_multi_exec和gcm推送通知和PHP
  • Jquery Ajax将数据传递到另一个php文件来更新数据库只允许更新一次(Wordpress)
  • 在php中更改csv文件的编码
  • 如何在list.phtml(Magento)中显示产品属性,其中库存可用性为“库存”
  • 尝试使用带有jQuery验证小部件的sendmail.php的表单邮件
  • 突出显示从mysql查询Codeigniter返回的视图页面上的搜索关键字。
  • 将表中的日期与今天的日期进行比较
  • 数字到唯一字符组合
  • cURL没有使用SNI在Web服务器上工作
  • 适当的Composer Package + Git开发工作流程
  • 在PHP中使用Twitter API获取表情符号
  • Laravel with Maatwebsite在v 4.1.30中返回空数组
  • 如何在Google +中获取我圈子中的朋友列表
  • 使用SimpleHTMLDOM获取class属性
  • 应用程序在提取数据时挂起
  • Magento基于GeoIP的相同产品但价格不同?

Copyright ©2022 我爱占星 All Rights Reserved.

浙ICP备2022030071号-1

部分图文来自网络,如有侵犯您的版权,请告诉我们删除

友情链接:代码精华