order by in codeigniter query builder

Solutions on MaxInterview for order by in codeigniter query builder by the best coders in the world

we are a community of more than 2 million smartest coders
registration for
employee referral programs
are now open
get referred to google, amazon, flipkart and more
register now
  
pinned-register now
showing results for - "order by in codeigniter query builder"
Isabella
28 Feb 2017
1$this->db->order_by('title', 'DESC');
2// Produces: ORDER BY `title` DESC
3
Rebeca
13 May 2018
1$this->db->order_by('RegisteredUserID','ASC')
2// Produces: ORDER BY `RegisteredUserID` ASC
3
4$this->db->order_by('RegisteredUserID','DESC')
5// Produces: ORDER BY `RegisteredUserID` DESC