Welcome Guest, Not a member yet? Register   Sign In
ORDER BY CLAUSE
#1

[eluser]yousuf_007sys[/eluser]
I need to arrange my records in the order of my id & i can't figure out how to do it using active record. please help me out

Code:
$q = $this->db->get_where('mydiary', array('username' => $username))->orderby('id');

Any help will be highly appreciated
#2

[eluser]Tom Schlick[/eluser]
[quote author="yousuf_007sys" date="1248167316"]I need to arrange my records in the order of my id & i can't figure out how to do it using active record. please help me out

Code:
$q = $this->db->get_where('mydiary', array('username' => $username))->orderby('id');

Any help will be highly appreciated[/quote]

Code:
$this->db->order_by('id');
$this->db->where(array('username' => $username));
$q = $this->db->get('mydiary');

ive always done it the long way. it has never failed.
#3

[eluser]yousuf_007sys[/eluser]
thanks man!!




Theme © iAndrew 2016 - Forum software by © MyBB