Welcome Guest, Not a member yet? Register   Sign In
Pagination through search results
#1

[eluser]Thorpe Obazee[/eluser]
I am currently having problem with my code when searching through a keyword. This is currently what I have.
Code:
function search($keyword = FALSE)
    {  
        $keyword = $this->input->xss_clean($this->uri->segment(3));
        
        $this->job_model->keyword = $keyword;
        
        $data['count_result'] = $this->job_model->count_result();
        
        $config['base_url'] = base_url().'index.php/job/search/'.$keyword.'/';
        $config['total_rows'] = $data['count_result'];
        $config['per_page'] = 3;
        
        // initialize pagination class
        $this->pagination->initialize($config);
        
        $offset = (int)$this->uri->segment(4);
        
        $data['posts'] = $this->job_model->search($config['per_page'], $offset);

        $this->load->view('search',$data);

    }

The problem is that when I click on the second page, nothing happens. I am still on the first page results...


Messages In This Thread
Pagination through search results - by El Forum - 05-08-2008, 02:47 AM
Pagination through search results - by El Forum - 05-08-2008, 02:59 AM
Pagination through search results - by El Forum - 05-08-2008, 03:07 AM
Pagination through search results - by El Forum - 05-08-2008, 03:17 AM
Pagination through search results - by El Forum - 05-08-2008, 03:27 AM



Theme © iAndrew 2016 - Forum software by © MyBB