Posted by Arjun on Tuesday 4th August 2020

Fetch Data From Database In Descending In CodeIgniter

To fetch data in descending order from the database in CodeIgniter you need to use the order_by() along with get() method.

Below is the sample code.

return $this->db->order_by('column_name', 'desc')->get('table_name')->result();