Welcome Guest, Not a member yet? Register   Sign In
In Model how to select all last data starting from 5th row ?
#3

(12-07-2014, 07:11 PM)includebeer Wrote: Remove the "where" clause and use "limit" :

$this->db->limit(5);
thank you for reply
if if use limit(5) result will give me last 5 rows but my question is quite different. and yesterday i found solution for that

added following code in
Code:
$q = $this->db->query('SELECT site_id FROM sites ORDER BY site_id DESC LIMIT 1');

$row = $q->row();
$b = $row->site_id+1-5;
$this->db->where('site_id <',$b);


and worked like a charm
Reply


Messages In This Thread
RE: In Model how to select all last data starting from 5th row ? - by paju89 - 12-08-2014, 04:21 AM



Theme © iAndrew 2016 - Forum software by © MyBB