Answers for "codeigniter 3 order"

PHP
0

codeigniter 3 order

$this->db->order_by('title', 'DESC'); 
// Produces: ORDER BY `title` DESC

$this->db->order_by('title DESC, name ASC');
// Produces: ORDER BY `title` DESC, `name` ASC

$this->db->order_by('title', 'DESC');
$this->db->order_by('name', 'ASC');
// Produces: ORDER BY `title` DESC, `name` ASC

$this->db->order_by('title', 'RANDOM');
// Produces: ORDER BY RAND()

$this->db->order_by(42, 'RANDOM');
// Produces: ORDER BY RAND(42)
Posted by: Guest on September-04-2021

Browse Popular Code Answers by Language