this db order by codeigniter code example
Example 1: codeigniter order by
$this->db->from($this->table_name);
$this->db->order_by("name", "asc");
$query = $this->db->get();
return $query->result();
Example 2: codeigniter query builder order by
$this->db->order_by('title', 'DESC');
// Produces: ORDER BY `title` DESC