Can't apply WHERE condition in Mulitple checkbox - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: Can't apply WHERE condition in Mulitple checkbox (/showthread.php?tid=58012) |
Can't apply WHERE condition in Mulitple checkbox - El Forum - 05-06-2013 [eluser]Unknown[/eluser] Hello Masters, I need help.I can't apply **WHERE** Condition clause in my Multiple selected checkbox value.like If i select 'accounitng' or 'php' then i want here use a condition like **WHERE** **("skill", "php")** here, skill table field name and php checkbox selected value.If i select a category 'PHP' so all 'PHP' related data only show.Checkbox selected value save into databse with ' , ' comma separated. like *`php,java,accounting,sql`* For save data i used for Model: Code: public function saveInstituteOfferCourse($data = array()) { for controller i use: Code: public function saveCourses() { My workflow likes: First: user select many skills using multiple checkbox and save selected data into DB table. Second: if anyone click on category on fronted page like php or java then only php or java related data information/list show. How can i do this please help me or suggest me for best.if possible provide me source code in codeignitor. My applying code have a look, Model, Code: public function selectaccoutingins() { Controller, Code: function accounting_ins_list() { view, Code: <tbody> Best regards, Can't apply WHERE condition in Mulitple checkbox - El Forum - 05-06-2013 [eluser]rana[/eluser] I didn't go through very deeply with your codes. But from your main concern, it seems like you should use Code: $this->db->where_in('skill',array("php","javascript")); Please see if it works for you... |