codeigniter - getting a value from an array in model -
i need value of array in model compare value.how can it?
code in model:
function get_order(){ $this->db->select('order'); $this->db->order_by('order','desc'); $this->db->limit(1); $query=$this->db->get('section');
i need last order record $query.i tried code not show .
echo $query['order'];
thanks help
try this,
function get_order() { $result = $this->db->select('order'); ->order_by('order','desc'); ->limit(1) ->get('section') ->row(); return $result->order; }
this function return order
.
hope helps :)
Comments
Post a Comment