Reputation: 585
how to check if the order_by method implemented in CodeIgniter? i tried with several variations on the code below, none of which worked
function getPRs(){
$this->db->from('press_releases');
$this->db->order_by('sort_order', 'asc');
$query = $this->db->get();
return $query->result();
}
any help on this would be greatly appreciated!, thanks
Upvotes: 0
Views: 63
Reputation: 390
Please try this code once.
$this->db->select('*');
$this->db->from('press_releases');
$this->db->order_by('sort_order', 'asc');
$query = $this->db->get();
return $query->result_array();
Upvotes: 2
Reputation: 490
try this
function getPRs(){
$this->db->order_by('sort_order', 'asc');
$query = $this->db->get('press_releases');
return $query->result();
}
Upvotes: 0