Answer the question
In order to leave comments, you need to log in
How to sort data in reverse order in a query?
I extract the last 3 comments by query. Question - how now these 3 comments are sorted in reverse order?
$this->db->order_by('id DESC');
$limit = 300;
$offset = 3;
$query = $this->db->get_where('comments', array('id' => id), $limit, $offset);
return $query->result_array();
Answer the question
In order to leave comments, you need to log in
array_reverse($array, true);
It won't work?
ps: php.net/manual/en/array.sorting.php
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question