title: Retrieving the last two days record
body: <p>how to get last two days record here is my query but getting errors.</p>
  
  <pre><code>function getbdologHistoryByRefManuals($obj)
  {
      $this-&gt;db-&gt;select('bdo_logs.*,transaction_statuses.status');
      $this-&gt;db-&gt;from('bdo_logs');
      $this-&gt;db-&gt;join('transactions','transactions.id=bdo_logs.id');
      $this-&gt;db-&gt;join('transaction_statuses','transaction_statuses.id=transactions.trans_status_id');
      $this-&gt;db-&gt;where('log_date &gt;', ADDDATE( CURDATE( ) , INTERVAL -2 DAY ));
  
      $query = $this-&gt;db-&gt;get();
  
      //echo $this-&gt;db-&gt;last_query();
      if($query-&gt;num_rows() == 0){
          return null;
      }
  
              return $query-&gt;result();
  }
  </code></pre>