title: jquery datatables search php [codeigniter] not working
body: <p>I am using jquery datables for showing some stocks. By default all stock are showing but when I type some text in search box nothing happens, I have also check console there is no error, Please help me. Here is some code:</p>
  
  <p><strong>stock.js</strong></p>
  
  <pre><code>$('#view-stock').DataTable({
      serverSide:true,
      searchable:true,
      ajax:{
          url:base_url+"stock/get_stock",
      }..and so on
  </code></pre>
  
  <p><strong>stock_controller:</strong></p>
  
  <pre><code>public function get_stock(){
      $stock['data']=$this-&gt;Stock_model-&gt;get_stock();
      if(isset($_GET['search[value]'])){
          $stock['data']=$this-&gt;Stock_model-&gt;get_stock($_GET['search[value]']);
      }
      $stock=json_encode($stock);
      print_r($stock);
  }
  </code></pre>
  
  <p><strong>stock model:</strong></p>
  
  <pre><code>public function get_stock($search=null){
              $this-&gt;db-&gt;order_by('id','desc');
              if($search!=null){
                  $this-&gt;db-&gt;like('p_name', $search);
                  $stock=$this-&gt;db-&gt;get('stockdetail');
              }else{
                  $stock=$this-&gt;db-&gt;get('stockdetail');
              }
              if($stock){
                  return $stock-&gt;result_array();
              }
              return false;
  }
  </code></pre>
  
  <p>Please help.</p>