title: how search between date using post in codeignitier
body: <p>Dear Expert need Help first see my view code in codeigniter :</p>
  
  <pre><code> &lt;div class="form-group"&gt;
        &lt;label for="tglawal" class="col-sm-2 control-label"&gt;Periode&lt;/label&gt;
       &lt;div class="col-sm-3"&gt;
        &lt;div class="input-group date"&gt;
        &lt;div class="input-group-addon"&gt;
         &lt;i class="fa fa-calendar"&gt;&lt;/i&gt;
        &lt;/div&gt;
       &lt;input type="date" class="form-control" name="tglawal" id="tglawal"&gt;                 
      &lt;/div&gt;
     &lt;/div&gt;
     &lt;div class="col-sm-3"&gt;
         &lt;div class="input-group date"&gt;
           &lt;div class="input-group-addon"&gt;
             &lt;i class="fa fa-calendar"&gt;&lt;/i&gt;
           &lt;/div&gt;
          &lt;input type="date" class="form-control" name="tglakhir" id="tglawal1"&gt;                 
         &lt;/div&gt;
    &lt;/div&gt;
  &lt;/div&gt; 
  </code></pre>
  
  <p>and this my model code :</p>
  
  <pre><code>private function _get_datatables_query()
      {       
          //add custom filter here
          if($this-&gt;input-&gt;post('tglawal'))
          {
          $this-&gt;db-&gt;where('b.tglawal', $this-&gt;input-&gt;post('tglawal'));
          }
              if($this-&gt;input-&gt;post('tglakhir'))
              {
                  $this-&gt;db-&gt;where('b.tglakhir', $this-&gt;input-&gt;post('tglakhir'));
              }
      }
  public function get_datatables()
      {
          $this-&gt;_get_datatables_query();
          if($_POST['length'] != -1)
          $this-&gt;db-&gt;limit($_POST['length'], $_POST['start']);
          $query = $this-&gt;db-&gt;get();
          return $query-&gt;result();
      }
  </code></pre>
  
  <p>and my controller if i get the important code is:</p>
  
  <pre><code>public function index()
      {
          $this-&gt;load-&gt;helper('url');
          $this-&gt;load-&gt;helper('form');
          $this-&gt;load-&gt;view('infokunjungan_view', $data);  
          } 
          else redirect(base_url());
      }
  
      public function ajax_list()
      {
      $list = $this-&gt;Infokunjungan-&gt;get_datatables();
      $data = array();
      $no = $_POST['start'];
      foreach ($list as $infokunjungan) {
              $no++;
              $row = array();
              $row[] = "&lt;td style='vertical-align:middle'&gt;&lt;center&gt;{$no}&lt;center&gt;&lt;/td&gt;";
      $row[] = "&lt;td style='font-size:9px; vertical-align:left;'&gt;{$infokunjungan-&gt;tglawal}&lt;center&gt;&lt;/td&gt;";
      $row[] = "&lt;td style='font-size:9px; vertical-align:left;'&gt;{$infokunjungan-&gt;tglakhir}&lt;center&gt;&lt;/td&gt;";
      $output = array(
              "draw" =&gt; $_POST['draw'],
              "recordsTotal" =&gt; $this-&gt;Infokunjungan-&gt;count_all(),
              "recordsFiltered" =&gt; $this-&gt;Infokunjungan-&gt;count_filtered(),
              "data" =&gt; $data,                        
                  );
          //output to json format
          echo json_encode($output);      
      }
  </code></pre>
  
  <p>the problem is if searching between two date tglawal and tglakhir</p>
  
  <p>im using between 2016-12-04 and 2016-12-04 output display will empty
  but if using between 2016-12-04 and 2016-12-06 output success where is my problem or maybe im using where or i have to use like? </p>