CodeIgniter 查询返回具有多个 where 条件的行数
SELECT COUNT(*) AS numrows
FROM (books)
WHERE (
id_status =1
OR id_status =2
)
AND company =2
如何将其转换为 CI Active Record?
SELECT COUNT(*) AS numrows
FROM (books)
WHERE (
id_status =1
OR id_status =2
)
AND company =2
How can this be converted to CI Active Record?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
只需三个方法调用即可优雅地实现 SQL。返回的值将是
int
类型值(而不是具有num_rows
属性的对象)。Your SQL is elegantly achieved with just three method calls. The returned value will be an
int
type value (not an object with anum_rows
property).