Zastanawiałem się, czy ktoś może mi w czymś pomóc.Codeigniter - Zamawianie aktywnego rekordu alfabetycznie
Mam trochę ajax, który wywołuje funkcję w moim modelu.
Ale wydaje się, że nie mogę zamówić wyjścia przez "model".
Poniżej funkcja im kłopoty z
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;
}
}
'$ this-> db-> order_by ('model')'? –