Pagination problem in CI |
[eluser]rajyakshmik[/eluser]
Hi, I m facing one problem in pagination.Records are showing corretcly and page numbers are not showing properly.If i click pagenum2 also still page 1 link is activated and records are as per 2page.Can u please help me on this. This is my controller function couponsissued($dealid) { $this->load->library('pagination'); $config['base_url'] = $this->config->item('base_url').'main/couponsissued/'.$dealid; $usrdata = array( 'dealid' => $dealid ); $this->session->set_userdata($usrdata); $this->db->where('DealID', $dealid ); $this->db->from('code'); $config['total_rows'] = $this->db->count_all_results(); $config['per_page'] = '1'; $config['full_tag_open'] = '<p>'; $config['full_tag_close'] = '</p>'; $this->pagination->initialize($config); $this->load->model('coupons_model'); $data['results'] = $this->coupons_model->get_coupons($config['per_page'],$this->uri->segment(5)); $this->load->view('couponsissued.html',$data); } Before clicking pagination my url is http://colonizer1/dealfrontier/main/coup...ed/RES0001 After clicking pagination my url is http://colonizer1/dealfrontier/main/coup...001/1(when i m second page)
[eluser]Thorpe Obazee[/eluser]
Code: $config['uri_segment'] = 4; Try adding this to the config array.
[eluser]Thorpe Obazee[/eluser]
no problem. I probably have 3 or more topic answers similar to this :p |
Welcome Guest, Not a member yet? Register Sign In |