[英]A problem with pagination codeigniter (page 2 not showing)
当我使用分页代码点火器显示来自数据库的数据时,即时通讯卡住了,正确显示了第一页,但是当我单击第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);
任何人都可以帮助我,谢谢!
检查您的模型如何获取页面数据。 您必须在该功能中设置要查找的页面,例如
function getPage($count = 5, $from = 0) { // params are important
$this->db->select('*', FALSE);
..........
$query = $this->db->get('your_table', $count, $from); // <- that's important: $count, $from
return $query->result();
}
听起来您好像缺少了'from'参数或类似的东西
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.