In Model how to select all last data starting from 5th row ? |
For examle there is 10 rows in table. My issue is how to fetch all data but starting from 5th row and 4 3 2 1 and so on?
Below code works but only with id numbers. so when my datas in table id will be mixed up like 50 46 42 40 and so on that code wont work. Code: public function fetch_data() {
(12-07-2014, 07:11 PM)includebeer Wrote: Remove the "where" clause and use "limit" :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'); and worked like a charm |
Welcome Guest, Not a member yet? Register Sign In |