use_page_numbers in codeigniter pagination class?

前端 未结 1 468
傲寒
傲寒 2021-01-26 11:40

I have a problem with using use_page_numbers config set to true in my pagination class! When I click on the link of page 2, the number of rows it retrieves from database is cor

相关标签:
1条回答
  • 2021-01-26 12:26

    You have a problem in calculation of offset variable.... Try this one:

    $page_num = $this->uri->segment(4, 0);
    
    $offset = ($page_num - 1) * $config['per_page'];
    
    0 讨论(0)
提交回复
热议问题