title: trying to filter the data between two dates in codeigniter using ajax
body: <p>I have a form where i have two dates option <strong>date from</strong>
   and <strong>date to</strong> and when user clicks i am calling ajax: </p>
  
  <pre><code>$.ajax({
      url: $url,
      type: "POST",
      dataType: 'json',
      data: $data,
      success: function (response)
      {
      if (response.status == 'OK') 
                  {
                      var sales_summary = response.sales_summary;
                      $('#example1').find('tbody').empty();
                      $u = 1;
                      $.each(sales_summary, function() 
                      {
                          var new_row = '&lt;tr&gt;'+
                              '&lt;td&gt;' + $u + '&lt;/td&gt;'+
                              '&lt;td&gt;' + this.name + '&lt;/td&gt;'+
                              '&lt;td&gt;' + this.datetime + '&lt;/td&gt;' +
                          '&lt;/tr&gt;';
                          $u++;
                          $('#example1').find('tbody').append(new_row);
                          $('#loading_div').hide();
                      });
  
                  }
      }`
  </code></pre>
  
  <p>php code in sql query where i am filtering the data by date:</p>
  
  <pre><code>if ($filter['date_from'] != '') {
         $this-&gt;db-&gt;where('transaction.created_on &gt;=', strtotime($filter['date_from'])+3600);
      }
  if ($filter['date_to'] != '') {
         $this-&gt;db-&gt;where('transaction.created_on &lt;=', strtotime($filter['date_to'])+89999);
      }
  </code></pre>
  
  <p><strong>data type (Date)</strong> = int(11)</p>
  
  <p><strong>error</strong> = SyntaxError: Unexpected token &lt; in JSON at position 1</p>
  
  <p><strong>error position</strong> = the above php code</p>