SELECT * FROM cdr WHERE (Circle LIKE '%D%' OR CLI LIKE '%D%' OR Operator LIKE '%D%') AND Dept = 'Sale'
我只想要它像$ this-> db->喜欢('Circle','%D%')和部门'和'。
答案 0 :(得分:1)
您应该阅读codeigniter文档,这很简单:
$this->db->where("(Circle LIKE '%D%' OR CLI LIKE '%D%' OR Operator LIKE '%D%')")
->where("dept", "Sale");
$query = $this->db->get("cdr");
http://www.codeigniter.com/user_guide/database/active_record.html