I have two variables, $take
(limit) and $skip
(offset) which are the values for a limit clause in mysql.
Now Code Igniter does it's limit clauses backwards.
E.g.
$this->db->limit(5,10)
would product LIMIT 10, 5
in MYSQL.
Anyway, I am having a hard time getting my head around how to call the limit
function based on which of the two values are set.
Basically,
If they are both set I want to call
$this->db->limit($take, $skip)
If only $take
is set I want to call
$this->db->limit($take)
But what do I call if only $skip is set, e.g. if
$skip = 10` then I want to show all rows, except for the first 10.
Do I call
$this->db->limit(null, $skip)
or
$this->db->limit(0, $skip)
or
$this->db->limit(false, $skip)
or
something completely different?