Welcome Guest, Not a member yet? Register   Sign In
My pagination link is not working
#1

[eluser]nencor[/eluser]
i have 10 record in the table. with a pagination *picture link can't attached to the post*

and i click the pagination link, the record is not changing. for example

there's
1
2
3
4
5
on pagination link 1

when i click on pagination link 2, the value still showing
1
2
3
4
5
not 678910

and here is my controller
Code:
$query = $this->m_kategorimaterial->get();  
    $config['base_url'] =  base_url().'index.php/c_kategorimaterial/index/';
    $config['total_rows'] = $query->num_rows();
    $config['per_page'] = 5;
    $this->pagination->initialize($config);
    $data['rows'] = $query->result();
    $data['title'] = 'QB Kategori Material';
    $this->load->view('menu',$data);
    $this->load->view('v/vkategorimaterial');

here is the model to get the database record
Code:
$this->db->order_by('Kode_Kategori_Material_Jasa','DESC');
    $query = $this->db->get('ms_kategori_material');
    return $query;

how do i resolve it ?
#2

[eluser]Aken[/eluser]
You need to add a limit and offset to your query. The pagination library doesn't do this for you, it only generates the link HTML.
#3

[eluser]Sanjay Sarvaiya[/eluser]
no need to pass index method on base_url it will call buy default.
#4

[eluser]Aken[/eluser]
[quote author="Sanjay Sarvaiya" date="1351235524"]no need to pass index method on base_url it will call buy default.[/quote]

site_url() adds the index segment; base_url() does not.




Theme © iAndrew 2016 - Forum software by © MyBB