title: Codeigniter Pagination not working
body: <p>I am using pagination class in codeigniter for my project and for some reason it's not working correctly. It is only displaying the first 3 results from my db and my "$config[per_page] = 3" and I have 20 items in my database.</p>
  
  <p>Here is my controller:</p>
  
  <pre><code>$this-&gt;load-&gt;library('pagination');
  
  $config['base_url'] = 'http://localhost/ci/admin/prod/viewprod';
  $config['total_rows'] = $this-&gt;db-&gt;get('retail_prod')-&gt;num_rows();
  $config['uri_segment'] = 5;
  $config['per_page'] = 3;
  $config['num_links'] = 5;
  
  $this-&gt;pagination-&gt;initialize($config);
  
  $data['records'] = $this-&gt;db-&gt;get('retail_prod', $config['per_page'], $this-&gt;uri-&gt;segment(5));
  </code></pre>
  
  <p>Here is my view:</p>
  
  <pre><code>&lt;?php 
  echo $this-&gt;table-&gt;generate($records);
  echo $this-&gt;pagination-&gt;create_links(); 
  ?&gt;
  </code></pre>
  
  <p>BTW: I am not using routes yet.</p>