CodeIgniter分页未显示正确的数据 [英] CodeIgniter pagination not showing correct data
本文介绍了CodeIgniter分页未显示正确的数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
嘿伙计们,
我有一个分页,我注意到所有链接显示相同的数据列表,它显示相同的前五个因为我设置了限制为5.任何人都知道这个?
控制器:
Hey guys,
I have a pagination and I noticed that all the links shows the same list of data, it shows the same first five because I set the limit to 5. Anyone knows this?
Controller:
$this->load->library('table');
$config['base_url']='http://localhost/AnimeInventory/index.php/maincontroller/records';
$config['total_rows'] = $this->db->get('detail')->num_rows();
$config['per_page'] = 5;
$config['num_links'] = 2;
$config['uri_segment'] = 3;
$data['getRecords'] = $this->inventoryModel->selectData($config['per_page'],$this->uri->segment(3));
$this->pagination->initialize($config);
$this->load->view('template/header');
$this->load->view('printdog',$data);
$this->load->view('template/footer');
型号:
Model:
public function selectData(){
$sql = "SELECT detail.id, detail.Title, genre.GenreName, detail.EntryDate From detail
INNER JOIN genre on detail.GenreID = genre.GenreID LIMIT 5 OFFSET 5";
$daf = $this->db->query($sql);
return $daf->result_array();
}
谢谢,
Thanks,
推荐答案
this-> ; load-> library(' table');
this->load->library('table');
config [' base_url'] = ' http://localhost/AnimeInventory/index.php/maincontroller/records';
config['base_url']='http://localhost/AnimeInventory/index.php/maincontroller/records';
config [' total_rows'] =
config['total_rows'] =
这篇关于CodeIgniter分页未显示正确的数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文