Sorting a query |
[eluser]Maximilian Schoening[/eluser]
Hi, how can I easily sort the output of this query. I would like to keep using an "active record" function and not my own SQL query: Code: function myfunction($id, $count, $offset) { Thanks, Max
[eluser]umefarooq[/eluser]
you can sort you records by following ways in active recods Code: by default asc sort check user guide also http://ellislab.com/codeigniter/user-gui...ecord.html
[eluser]Maximilian Schoening[/eluser]
Thanks for the fast reply. Ok so I am doing this: Code: function get($email, $count, $offset) { This works fine but somehow if I don't pass the user_id to the $user_id variable but do this directly: Code: function get($email, $count, $offset) { It stops working. Any ideas? Thanks, Max
[eluser]umefarooq[/eluser]
for that you have to print you query to check it proper query and parameter you are passing is correct or not for that use the following helper function Code: $this->db->last_query(); it will print your sql which you can use to check query it fine or not http://ellislab.com/codeigniter/user-gui...lpers.html |
Welcome Guest, Not a member yet? Register Sign In |