I was wondering if someone could help me out with something.
I have a bit of ajax that calls a function in my model.
But i cant seem to be able to order the output by 'model'.
Below the function im having trouble with
function get_models_by_brand($tree = null)
{
$this->db->select('id, model');
if($tree != NULL){
$this->db->where('brand_id', $tree);
}
$query = $this->db->get('models');
$models = array();
if($query->result()){
foreach ($query->result() as $model) {
$models[$model->id] = $model->model;
}
return $models;
} else {
return FALSE;
}
}