title: CodeIgniter Count Records for Query that Excludes Limit Condition
body: <p>I want to do two things in one query: use the limit() function, but also get the total number of records as a record count for the query, as if the limit wasn't used. So, if there are 21 total records that meet the conditions <code>like '%Gregory%'</code>, I would like that value returned, even though I'm using a <code>limit(10,0)</code>.</p>
  
  <p>Here's my code:</p>
  
  <pre><code>    $data['recordcount'] = $this-&gt;db-&gt;count_all_results('assets');
      $this-&gt;db-&gt;limit(10, 0);
      if(isset($data['order'])){ 
          $query = $this-&gt;db-&gt;select('*')-&gt;from('assets')-&gt;or_like($array)-&gt;order_by($column, $data['order'])-&gt;get();
      }
  </code></pre>
  
  <p>The problem is that $data['recordcount'] in the first line returns all records. I want it to return all records that meet the query condition in the 4th line, but without the limit found in the 2nd line.</p>