Odering results in descending - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Libraries & Helpers (https://forum.codeigniter.com/forumdisplay.php?fid=22) +--- Thread: Odering results in descending (/showthread.php?tid=40900) |
Odering results in descending - El Forum - 04-21-2011 [eluser]Alias M2K[/eluser] Guys, I was wondering if there is any way to order the results from MySQL tables in descending order? I mean any active query other than the classic MySQL query? Thanks Odering results in descending - El Forum - 04-21-2011 [eluser]Eric Barnes[/eluser] Sure you can: Code: $this->db->from('table')->order_by('id', 'desc'); Odering results in descending - El Forum - 04-21-2011 [eluser]kotakorange[/eluser] use $this->db->order_by('field', 'sort'); You can read the user guide Odering results in descending - El Forum - 04-22-2011 [eluser]Alias M2K[/eluser] Thanks dude Just made few modifications on it, and I am done! Thanks! |