Skip to content

Fetch Data From Database In Descending In CodeIgniter

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();

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Most Voted
Newest Oldest
Inline Feedbacks
View all comments