Welcome Guest, Not a member yet? Register   Sign In
Pagination, offset issue
#2

[eluser]Unknown[/eluser]
Hi

I am also new to codeigniter but If you try

Quote:$config['query_string_segment'] = 'offset';
$config['page_query_string'] = TRUE;

as

Code:
$this->load->library('pagination');
$config['base_url'] = base_url().'index.php/books/index/';
$config['total_rows'] = $this->db->count_all('books');            //returns 17
$config['per_page'] = '5';
$config['full_tag_open'] = '<p>';
$config['full_tag_close'] = '</p>';
        
$config['query_string_segment'] = 'offset';
$config['page_query_string'] = TRUE;

and then you will get offset in your url
and may be you don't need following code
Code:
if (isset($page) && is_numeric($page))
            {
              $offset = ($page-1) * $config['per_page'];
            }
            else
            {
              $offset = 0;
            }


See if this helps.


Messages In This Thread
Pagination, offset issue - by El Forum - 01-12-2010, 04:48 AM
Pagination, offset issue - by El Forum - 01-13-2010, 08:16 AM
Pagination, offset issue - by El Forum - 01-13-2010, 11:15 AM
Pagination, offset issue - by El Forum - 01-13-2010, 04:09 PM
Pagination, offset issue - by El Forum - 01-13-2010, 07:15 PM
Pagination, offset issue - by El Forum - 01-14-2010, 03:09 AM
Pagination, offset issue - by El Forum - 01-14-2010, 04:47 AM
Pagination, offset issue - by El Forum - 01-14-2010, 05:24 AM



Theme © iAndrew 2016 - Forum software by © MyBB