Welcome Guest, Not a member yet? Register   Sign In
Pagination - Am I Missing something about per_page?
#1

[eluser]developer10[/eluser]
I'm wondering what's the purpose of $config['per_page'] item if it doesnt automatically
splits my records in order to show them in a defined number per page?

i set it, let's say, 10 items per page, and still pagination loads them all. then i need to manually insert
LIMIT in my query, but then again, i have to mess with other things again.

my model function:

Code:
function getUserInputs($username)
    {    
        $config['per_page'] = 12;

        $this->db->select()->from('_tbl_firme');
        $this->db->join('users', '_tbl_firme.id = users.id', 'left');
        $this->db->where('username', $username);
        $this->db->order_by('f_vrijeme', 'desc');
//        $this->db->limit($config['per_page'],0);
        $query = $this->db->get();
        
        $pagBase = site_url().uri_string().'/start';
        $config['base_url'] = $pagBase;
        $config['num_links'] = 4;
        $config['uri_segment'] = $this->uri->total_segments();

        $this->pagination->initialize($config);

        if($query->num_rows() > 0) {
            $result = $query->result();
        }
        
        return $result;
    }

maybe someone would be kind enough to explain to me how to use this item properly.
thanks!


Messages In This Thread
Pagination - Am I Missing something about per_page? - by El Forum - 01-01-2010, 03:31 PM
Pagination - Am I Missing something about per_page? - by El Forum - 01-01-2010, 04:29 PM
Pagination - Am I Missing something about per_page? - by El Forum - 01-01-2010, 05:27 PM
Pagination - Am I Missing something about per_page? - by El Forum - 01-01-2010, 11:50 PM
Pagination - Am I Missing something about per_page? - by El Forum - 01-02-2010, 05:18 AM



Theme © iAndrew 2016 - Forum software by © MyBB