分页 codeigniter 的问题(第 2 页未显示)
当我使用分页 Codeigniter 显示数据库中的数据时,我遇到了困难,第一页显示正确,但是当我单击第 2 页时,选择了页数,但它仍然显示第 1 页的数据,所以处理下一页。这是我的代码
$id = $this->uri->segment(3);
$perpage = 5;
$this->load->library('pagination');
$config['base_url'] = base_url().'index.php/contname/method/'.$id;
$config['total_rows'] = $this->feedbackmodel->count_itemscat($id);
$config['per_page'] = $perpage;
$config['uri_segment'] = 4;
$this->pagination->initialize($config);
请有人帮助我 提前致谢!
im getting stuck when i show data from database with pagination codeigniter, the first page is show correctly, but when i click page 2, the number of page is selected but its still show the data of page 1, so do with next page. Here is my code
$id = $this->uri->segment(3);
$perpage = 5;
$this->load->library('pagination');
$config['base_url'] = base_url().'index.php/contname/method/'.$id;
$config['total_rows'] = $this->feedbackmodel->count_itemscat($id);
$config['per_page'] = $perpage;
$config['uri_segment'] = 4;
$this->pagination->initialize($config);
Anyone help me please
Thanks in advance!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
检查您的模型如何获取页面数据。您必须在该函数中设置您要查找的页面,就像听起来
您缺少“from”参数或类似的东西
Check in your model how are you getting the page data. You must set the page you are looking for in that function, like in
it sounds like you are missing the 'from' param or something like that