codeigniter mysql活动记录

时间:2011-10-05 06:59:22

标签: php mysql codeigniter activerecord

SELECT COUNT( * ) AS  numrows 
FROM (
books
)
WHERE (
id_status =1
OR id_status =2
)
AND  company =2

如何转换为CI Active Record?

1 个答案:

答案 0 :(得分:1)

$this->db->select('count(*) as numrows')->from('books ')->where("(id_status='1' OR id_status='2') and company ='2'")