Order column desc in one query $data |
Hi ,maybe this just simple question, but i don't have answer yet
My query is this : $data['employee'] = $this->m_data->get_data('employee')->result(); I want to order descending, i try this $data['employee'] = $this->m_data->get_data('employee')->order_by("employee_id desc")->result(); But it gave error like this : Message: Call to undefined method CI_DB_mysqli_result::order_by() How to fix the query ? (02-20-2020, 02:02 AM)kelapamuda Wrote: Hi ,maybe this just simple question, but i don't have answer yetEvery method returns allows for chaning, except get and get_where which returns the result. Try to place order_by() before get_data()
Finally it works,i just changet the query sentence
$data['tbl_tamu'] = $this->db->query("SELECT * FROM tbl_tamu order by tbl_tamu_id desc")->result(); |
Welcome Guest, Not a member yet? Register Sign In |