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

[eluser]mddd[/eluser]
The order of the 'query bits' is NOT important. But it IS important to know the query methods from the result methods.
Once you put any kind of 'get' in there, the thing you get back is no longer the query you are buiding. It is the RESULT of the query you have built.

So:
Code:
$this->db->where('name','john)->order_by('age')->limit(3)->   get('users')   ->result();
is the same as
Code:
$this->db->limit(3)->order_by('age')->where('name','john')->from('users')->   get()   ->results();

But you can't use any function that shows you results before the get() part. Or the other way around.


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