php - how to use or_where and where in codeigniter -
i facing problem when using active record or_where
how or 1 particular field i.e meeting_status
$this->db->_protect_identifiers=false; $this->db->select("g.category_id,f.doc_type_id,g.category_name,f.doc_type_name,c.meeting_name_id, c.meeting_name mn, d.meeting_type_id, d.meeting_type_name, e.venue_id, e.venue_name, u.*, (select count(*) tbl_meeting_decisions meeting_id=u.meeting_id , record_status= 'active') `meeting_decision`, (select count(*) tbl_meeting_actions meeting_id=u.meeting_id , record_status= 'active') `meeting_action`, (select count(*) tbl_meeting_actions meeting_id=u.meeting_id , action_status='open' , record_status= 'active') `meeting_close_action`"); $this->db->from('tbl_meeting_plans u'); $this->db->join('tbl_meeting_names c', 'c.meeting_name_id = u.meeting_name'); $this->db->join('tbl_meeting_types d', 'd.meeting_type_id = u.meeting_mode_id'); $this->db->join('tbl_meeting_venue e', 'e.venue_id = u.venue_id '); $this->db->join('tbl_document_types f', 'f.doc_type_id = u.meeting_type_id '); $this->db->join('tbl_categories g', 'g.category_id = u.meeting_category_id '); $this->db->where(array('u.meeting_type_id'=>$str2,'u.meeting_category_id'=>$str1,'u.meeting_status'=>'planning','u.record_status'=>'active' )); $this->db->or_where(array('u.meesting_status'=>'meeting updated' ));
$where = "(u.meeting_status='planning' or u.meeting_status='meeting updated') "; $this->db->where($where);
before use normal clause
Comments
Post a Comment