Last updated on January 30, 2021
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();