Probably quite a simple one, but I’m not having any luck in the docs or searches.
I’m trying to add an order by clause to just one of my ActiveRecord queries as follows:
$result = $this->db->get('mytable');
$this->db->order_by('age', 'ASC');
It works, however I get errors because the order by clause is being applied to all my other queries and I get errors because my age column is not present in all tables.
So how do it limit $this->db->order_by(‘age’, ‘ASC’) to just that one specific query?
Thanks.
You should have
$this->db->order_by();before$result = $this->db->get('mytable');