codeigniter 3 order

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

showing results for - "codeigniter 3 order"
Raphael
05 Mar 2016
1$this->db->order_by('title', 'DESC'); 
2// Produces: ORDER BY `title` DESC
3
4$this->db->order_by('title DESC, name ASC');
5// Produces: ORDER BY `title` DESC, `name` ASC
6
7$this->db->order_by('title', 'DESC');
8$this->db->order_by('name', 'ASC');
9// Produces: ORDER BY `title` DESC, `name` ASC
10
11$this->db->order_by('title', 'RANDOM');
12// Produces: ORDER BY RAND()
13
14$this->db->order_by(42, 'RANDOM');
15// Produces: ORDER BY RAND(42)