Codeigniter - 带有 activerecord 的括号?
如何在 Codeigniter 的活动记录 SQL 查询中使用圆括号符号? 例如如何完成
SELECT * FROM `shops` WHERE (`shopid` = '10' OR `shopid` = '11') AND `shopid` <> '18'
How to have round brackets symbol in Codeigniter's active record SQL queries?
e.g. how to accomplish
SELECT * FROM `shops` WHERE (`shopid` = '10' OR `shopid` = '11') AND `shopid` <> '18'
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
$this->db->where($where, NULL, FALSE);
对于 AND 条件使用
即
$this->db->where($where, NULL, FALSE);
and for the AND condition use
ie
我认为你可以这样做:
不完全确定语法,我正在写这个。如果这不起作用,我回家后会看看。
I think you could do something like:
Not entirely sure about the syntax, I'm writing this off the top of my head. I'll take a look at it when I get home if this doesn't work.
你可以这样做:
来源:http://www.codeignitor.com/user_guide/database/active_record.html#where
You can just do something like:
Source: http://www.codeignitor.com/user_guide/database/active_record.html#where