Welcome Guest, Not a member yet? Register   Sign In
No results when paginate (WHERE something=$something)
#2

[eluser]Phil Sturgeon[/eluser]
Well you are not accepting the offset value in the controller if I understand you correctly. You are referencing segment 3 but it seems a little odd.

Here's how mine works:

Code:
function index($limit = 25, $offset = 0)
    {    
        $this->load->library('pagination');
        $this->load->model('test_model');
        
        $data['list'] = $this->test_model->getList($limit, $offset);
        
        // Pagination code
        $config['base_url'] = '/page/list/'.$limit.'/';
        $config['total_rows'] = $this->db->count_all('Table');
        $config['per_page'] = $limit;
        $config['uri_segment'] = 4;
        
        $this->pagination->initialize($config);
        $data['pagination'] = $this->pagination->create_links();
                
        //... make page

    }

Yours would be no different, simply add in your count with a WHERE and add an extra $catID to the start of the controller param list.


Messages In This Thread
No results when paginate (WHERE something=$something) - by El Forum - 06-29-2007, 04:06 PM
No results when paginate (WHERE something=$something) - by El Forum - 07-04-2007, 04:32 AM



Theme © iAndrew 2016 - Forum software by © MyBB