title: codeigniter active record get query and query without the LIMIT clause
body: <p>im using active record, its all working ok but i want to set the <strong>$data["totalres"]</strong> to the total results, i mean, the same query but without the <strong>LIMIT</strong></p>
  
  <p>the problem is the previous statements gets unset when you do a query modifier, so i cant even add the $this->db->limit() after i get the results.</p>
  
  <p>any ideas? i think its a bad practice to 'duplicate' the query just to do this</p>
  
  <pre><code>function get_search($start, $numrows, $filter = array())
  {    
  
      ...
  
      $this-&gt;db
      -&gt;select("emp")
      -&gt;from('emp')
      -&gt;join('empr', 'empr.b = empr.id', 'left')
      -&gt;like('code', $code)
      -&gt;limit($numrows, $start);
  
      ...
  
      $q = $this-&gt;db-&gt;get();        
  
      // number of rows WITHOUT the LIMIT X,Y filter
      $data["totalres"] = ???????;        
  
      if ($q-&gt;num_rows() &gt; 0)
      {        
          $data["results"] = $q-&gt;result();
      } else {
          $data["results"] = array();
      }   
  
      return $data;
  }    
  </code></pre>