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

Popular posts from this blog

android - Get AccessToken using signpost OAuth without opening a browser (Two legged Oauth) -

org.mockito.exceptions.misusing.InvalidUseOfMatchersException: mockito -

google shop client API returns 400 bad request error while adding an item -