Welcome Guest, Not a member yet? Register   Sign In
no pagination links
#1

[eluser]Frank Rocco[/eluser]
Hello,

I cannot get pagination links to show.
Am I doing something wrong?
total_rows is 1163

Code:
$this->load->library('pagination');
        $perpage = 5;
        $config['base_url'] = base_url() . 'index.php/product/index/';
        $data['total_rows'] = $this->product_model->getRecords(array('count' => TRUE,'sizenum' => $sizenum));
        $config['per_page'] = $perpage;
        $config['uri_segment'] =3;
        $this->pagination->initialize($config);
          echo $this->pagination->create_links();
#2

[eluser]Bainzy[/eluser]
yes .... you need to change $data['total_rows'] to .. $config['total_rows'] at the moment your pagination library cant figure out how many recoreds you have as you are not passing this information to it Smile
#3

[eluser]Frank Rocco[/eluser]
I can't tell you how long I looked at this code and never saw it.Sad

Thanks for your help.
#4

[eluser]Bainzy[/eluser]
no problem glad that fixed it Smile ... we all get that mate ! just take a break from your screen for 10 minutes and come back with a fresh set of eyes ... normally helps Smile




Theme © iAndrew 2016 - Forum software by © MyBB