• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Can't apply WHERE condition in Mulitple checkbox

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:

public function saveInstituteOfferCourse($data = array()) {
            if ($this->db->insert('tbl_course_offred', $data)) {
                return $this->db->insert_id();
            return FALSE;

for controller i use:

public function saveCourses() {
            $data = array();
            $this->form_validation->set_rules('skill', 'skill', 'required');
            if ($this->form_validation->run()) {
                /* @var $skill user_admin_controller */
                $skill = implode(',', $this->input->post('skill'));
                $data['skill'] = $skill;
                $data['user_id'] = $this->session->userdata('user_id');

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,


public function selectaccoutingins() {
            $this->db->from('tbl_user_reg, tbl_course_offred');
            $this->db->where('skill', "php");
            // here, i use two table 1 for information collect and other for category match condition value show.
            $query_result = $this->db->get();
            $result = $query_result->result();
            $result = explode(",", $query_result->result);
            return $result;


function accounting_ins_list() {
            $data = array();
            $data['result'] = $this->welcome_model->selectaccoutingins();
            $data['catepage_list'] = $this->load->view('accounting_ins_list', $data, true);
            $this->load->view('hmcate_select_page', $data);


                        if($result) {
                        foreach ($result as $aresult) {
                            <td>&lt;?php echo $aresult->institute_name;?&gt;</td>
                            <td>&lt;?php echo $aresult->contact_person; ?&gt;</td>
                            <td>&lt;?php echo $aresult->institute_address1;?&gt;</td>
                        &lt;?php }
                        }   ?&gt;
here i want to show only **PHP related** information list.Please help how can i solve this.

Best regards,

I didn't go through very deeply with your codes. But from your main concern, it seems like you should use

Please see if it works for you...

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

Users browsing this thread:
1 Guest(s)

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2019 MyBB Group.