gpt4 book ai didi

php - 在 CodeIgniter Activerecord 中执行 WHERE !=

转载 作者:行者123 更新时间:2023-11-29 00:08:11 27 4
gpt4 key购买 nike

如何在 CodeIgniter Activerecord 中执行 WHERE column != 100001?抱歉,我找不到任何关于此的资源。

我的查询是

$this->db->select('friend, username, fullname, profile_pic')
->from('friends')
->join('user_info', 'user_info.id = friend')
->where('user', $my->id)
->where('status', '1')
->get()->result_object();

我想添加 ->where('friend' != 10001) ?

最佳答案

永远记住第二个参数是值:

->where('friends.friend !=', 10001)

是的,这在 active record manual 上有详细记录.

它在 Custom key/value method: 部分 ->where() 方法中。

关于php - 在 CodeIgniter Activerecord 中执行 WHERE !=,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26520284/

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