0
SELECT COUNT(*) AS numrows
FROM (
books
)
WHERE (
id_status =1
OR id_status =2
)
AND company =2
如何轉換爲CI活動記錄?codeigniter mysql活動記錄
SELECT COUNT(*) AS numrows
FROM (
books
)
WHERE (
id_status =1
OR id_status =2
)
AND company =2
如何轉換爲CI活動記錄?codeigniter mysql活動記錄
$this->db->select('count(*) as numrows')->from('books ')->where("(id_status='1' OR id_status='2') and company ='2'")
如果結果足夠,可以使用'count_all_results'而不是'select',並且可以將'where'分成兩部分。 – uzsolt