Welcome Guest, Not a member yet? Register   Sign In
Pagination complications
#1

[eluser]Tyler Diaz[/eluser]
I've been working around this pagination for hours and cannot seem to find my way into it.

Code:
$this->load->library('pagination');

        $config = array(
                        'base_url'         => site_url('inbox'),
                        'total_rows'     => 21,
                        'per_page'         => 5,
                        'uri_segment'     => 2,
                        'full_tag_open'     => '<p>',
                        'full_tag_close' => '</p>'
                        );    

        $query = $this->db->query("SELECT x, x, x, x, x, x
                                   FROM `x`
                                   LIMIT ".$this->uri->segment(2).", ".$config['per_page']."

Originally the links would not work - Till I used this (".$this->uri->segment(2).") and now it return a MYSQL error due to it returns an empty string.

Then it does a foreach, then I initialize the config ($this->pagination->initialize($config)) and parse it in the view ('pagination' => $this->pagination->create_links(),) Any help?
#2

[eluser]elvix[/eluser]
you might try adding a default 0 to your segment function -- $this->uri->segment(2,0).

that way, you won't have it returning nothing.




Theme © iAndrew 2016 - Forum software by © MyBB