Codeigniters where and or where

codeigniters where and or where I am trying to use if($cat_id){ $this->db->where("q.question_cat_id",$cat_id); if($sub){ $this->db->where_or("q.question_sub_id",$cat_id); } } But geting error..
Ankur Rajput
Asked 16-11-2019
51

Answer (1)
You can modify just the two lines: $this->db->where('q.question_cat_id',$cat_id); $this->db->or_where('q.question_sub_id',$cat_id); replace where_or with or_where
Ankur Rajput
Asked 28-06-2018
45 Likes
Comments
Write comment

Submit your answer