Welcome Guest, Not a member yet? Register   Sign In
Query problems
#7

[eluser]TheFuzzy0ne[/eluser]
Code:
class Journel_model extends Model {
    
    function Model()
    {
        parent::Model();
    }
    
    function getLatest($start_result=1, $offset=20)
    {
        $this->db->order_by('post_date', 'desc');
        $this->db->limit($start_result, $offset);
        return $this->db->get('some_table');
    }
}
The code above is untested.

Modify the function so that it accepts two parameters.

Code:
$this->journal_model->get_latest(1); // page 1
$this->journal_model->get_latest(21); // page 2
$this->journal_model->get_latest(41); // page 3


Messages In This Thread
Query problems - by El Forum - 02-17-2009, 12:33 PM
Query problems - by El Forum - 02-17-2009, 01:13 PM
Query problems - by El Forum - 02-17-2009, 01:14 PM
Query problems - by El Forum - 02-17-2009, 01:42 PM
Query problems - by El Forum - 02-17-2009, 01:50 PM
Query problems - by El Forum - 02-17-2009, 06:14 PM
Query problems - by El Forum - 02-17-2009, 06:29 PM
Query problems - by El Forum - 02-17-2009, 06:42 PM



Theme © iAndrew 2016 - Forum software by © MyBB