Welcome Guest, Not a member yet? Register   Sign In
Pagination problem, offset seem to be not working
#1

[eluser]ReyPM[/eluser]
Hi, I'm having some problems with my pagination because for some reason the parameter at URL is always 10 and not 20 like I want. This is my code:
Code:
$offset_exists = $this->uri->segment(3);
$offset = $offset_exists ? 20 : 0;
        
keyword = $this->Convertedkitcylinder_model->keyword_handler($this->input->get_post('keyword', TRUE));
$total = $this->Convertedkitcylinder_model->AjaxSearchTotal($keyword);
$output_string = $this->Convertedkitcylinder_model->AjaxSearch($keyword, 20, $offset);

$this->load->library('pagination');
$config['base_url'] = site_url('convertedkitcylinder/ajaxsearch');
$config['total_rows'] = $total;
$config['row_per_page'] = 20;
$config['num_links'] = 2;

But my URL looks like: convertedkitcylinder/ajaxsearch for the first run, convertedkitcylinder/ajaxsearch/10 for the second, convertedkitcylinder/ajaxsearch/20 when I'm showing 20 items per page and $total takes 26 as value so just 2 pagination must be showed instead I get 3, why?




Theme © iAndrew 2016 - Forum software by © MyBB