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.
Here is my controller:
$this->load->library('pagination');
$config['base_url'] = 'http://localhost/ci/admin/prod/viewprod';
$config['total_rows'] = $this->db->get('retail_prod')->num_rows();
$config['uri_segment'] = 5;
$config['per_page'] = 3;
$config['num_links'] = 5;
$this->pagination->initialize($config);
$data['records'] = $this->db->get('retail_prod', $config['per_page'], $this->uri->segment(5));
Here is my view:
<?php
echo $this->table->generate($records);
echo $this->pagination->create_links();
?>
BTW: I am not using routes yet.