gpt4 book ai didi

php - 将数组传递到 Codeigniter Active Record 中的位置

转载 作者:IT王子 更新时间:2023-10-29 01:03:19 39 4
gpt4 key购买 nike

我的数据库中有一个包含 adminId 和 clientId 的表

登录用户的 adminId 可能有 20 条记录,我正在尝试提取客户列表。

我想知道我是否可以这样说:

$this->db->where('id', '20 || 15 || 22 || 46 || 86');

我正在尝试使用动态数据执行此操作(您永远不知道需要提取多少个客户端 ID)。有什么想法吗?

最佳答案

$this->db->where_in('id', ['20','15','22','42','86']);

引用:where_in

关于php - 将数组传递到 Codeigniter Active Record 中的位置,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13717555/

39 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com