Welcome Guest, Not a member yet? Register   Sign In
Active Record order_by with get_where
#1

[eluser]wlvrn[/eluser]
I'm not sure if this is an bug but it stumped me for a bit and I thought I should report it since it's a bit confusing and, at the very least, should be added to the documentation.

When using Active Record to create database queries, using the following statement will produce an error...

$query = $this->db->get_where('categories')->order_by('category', 'asc');

PHP Fatal error: Call to undefined method CI_DB_mysql_result::order_by() in...

Changing that to ...

$query = $this->db->order_by('category', 'asc')->get_where('categories');

... results in the query being executed as you would expect.


Messages In This Thread
Active Record order_by with get_where - by El Forum - 07-23-2010, 06:57 AM
Active Record order_by with get_where - by El Forum - 07-23-2010, 07:10 AM
Active Record order_by with get_where - by El Forum - 07-23-2010, 07:30 AM
Active Record order_by with get_where - by El Forum - 07-23-2010, 08:02 AM
Active Record order_by with get_where - by El Forum - 07-23-2010, 08:06 AM
Active Record order_by with get_where - by El Forum - 07-23-2010, 08:13 AM
Active Record order_by with get_where - by El Forum - 07-23-2010, 09:34 AM
Active Record order_by with get_where - by El Forum - 07-23-2010, 09:39 AM



Theme © iAndrew 2016 - Forum software by © MyBB