title: I am working on checkbox filter ,i am not getting to handle multiple values of checkbox in query where cause
body: <p>I am setting checked values in array  and passing that array to model function, I am not getting how to handle checkbox values in where clause of query</p>
  
  <p>my view page:</p>
  
  <pre><code>&lt;form id="filterform" method="post" action="&lt;?php echo base_url(); ?&gt;index.php/welcome/forFilter?id=&lt;?php echo $_GET['id']; ?&gt;&amp;name=&lt;?php echo $_GET['name']; ?&gt;"&gt;"&gt;
     &lt;?php foreach ($supplier as $menu1) { ?&gt;
       &lt;div class="checkbox"&gt;
         &lt;input type="checkbox"  name="state[]" id="" value="&lt;?php echo $menu1-&gt;state_name; ?&gt;" class="custm-position"&gt;
         &lt;label&gt;&lt;?php echo $menu1-&gt;state_name; ?&gt;&lt;/label&gt;
       &lt;/div&gt;
     &lt;?php } ?&gt;
   &lt;/form&gt;
  </code></pre>
  
  <p>my controller code:</p>
  
  <pre><code> public function forFilter(){
        $id = $_GET["id"];
        $total_row = $this-&gt;productdisplay_model-&gt;filter_count($id,$state_id);
        $this-&gt;applyFilter($state_id);
      }
  
      public function applyFilter($state_id){
          $data['ListMenuLevel1'] = $this-&gt;Categories_model-&gt;listsector1();
          $data['supplier'] = $this-&gt;supplier_select_model-&gt;select_supplier();
          $config = array();
          $config["base_url"] = base_url() . "index.php/welcome/applyFilter";
          $total_row = $this-&gt;productdisplay_model-&gt;filter_count($this-&gt;session-&gt;userdata('forfilter_id'),$state_id);
          $config['total_rows'] = $total_row;
          $config['per_page'] = 20;
          //$config['uri_segment'] = 3;
          $config['use_page_numbers'] = TRUE;
          //$config['page_query_string'] = TRUE;
          //$config['reuse_query_string'] = FALSE;
          $config['num_links'] = 1;
          $config['cur_tag_open'] = '&amp;nbsp;&lt;a class="current"&gt;';
          $config['cur_tag_close'] = '&lt;/a&gt;';
          $config['next_link'] = 'Next';
          $config['prev_link'] = 'Previous';
          $this-&gt;load-&gt;library('pagination');
          $this-&gt;pagination-&gt;initialize($config);
          /* if($this-&gt;uri-&gt;segment(3)){
            $page = ($this-&gt;uri-&gt;segment(3)) ;
            }
            else{
            $page = 1;
            } */
          $page = ($this-&gt;uri-&gt;segment(3) != '' ? $this-&gt;uri-&gt;segment(3) : 1);
          //$offset = $config['per_page']*$page;
          $offset = (($config['per_page']) * ($page - 1));
          $limit = $config['per_page'];
  
         $str_links = $this-&gt;pagination-&gt;create_links();
          $data["links"] = explode('&amp;nbsp;', $str_links);
          $data['sub3products'] = $this-&gt;productdisplay_model-&gt;filter_result($this-&gt;session-&gt;userdata('sub3_id'),$limit, $offset,$state_id);
          $this-&gt;load-&gt;view('productdetails', $data);
      }
  </code></pre>
  
  <p>my model:</p>
  
  <pre><code>public function filter_count($id,$state_id){
          $this-&gt;db-&gt;select('*');
          $this-&gt;db-&gt;from('sub3_category');
          $this-&gt;db-&gt;where('sub2_categoryid_fk', $id);
          $this-&gt;db-&gt;order_by("sub3_category.sub2_categoryid_fk ");
          $query = $this-&gt;db-&gt;get();
          return  $query-&gt;num_rows();
      }
  
       public function filter_result($id,$limit, $offset,$state_id){
           $this-&gt;db-&gt;select('*');
          $this-&gt;db-&gt;from('sub3_category');
          $this-&gt;db-&gt;where('sub2_categoryid_fk', $id);
          $this-&gt;db-&gt;order_by("sub3_category.sub2_categoryid_fk ");
          $this-&gt;db-&gt;join('supplier_otherdetails', 'sub3_category.supplier_id_fk=supplier_otherdetails.sup_id', 'left outer');
          $this-&gt;db-&gt;limit($limit, $offset);
          return $this-&gt;db-&gt;get()-&gt;result();
      }
  </code></pre>
  
  <p>my jquery</p>
  
  <pre><code>&lt;script&gt;
  $(document).ready(function(){
      $("#filterform").on("change", "input:checkbox", function(){
          $("#filterform").submit();
      });
  });
  &lt;/script&gt;
  </code></pre>