Welcome Guest, Not a member yet? Register   Sign In
Easy ActiveRecord questions
#1

[eluser]coding_hero[/eluser]
Ok, this is my first CI app, so this is a pretty simple question:

If I do a JOIN on two tables, and both have a field name in common (and it is not the field being joined on), how is that returned in the result?

For example:
Code:
$this->db->from ('user_access');
            $this->db->join ('collection',
                             'user_access.collection_id = collection.id');
            $this->db->where ('user_id', $user_id);
            $query = $this->db->get ();
If both 'user_access' and 'collection' have a field named 'name', and you accessed 'name' in $query->result(), which would you get? Is there any way to get the other?


Messages In This Thread
Easy ActiveRecord questions - by El Forum - 02-19-2009, 04:16 PM
Easy ActiveRecord questions - by El Forum - 02-19-2009, 05:08 PM
Easy ActiveRecord questions - by El Forum - 02-19-2009, 05:11 PM
Easy ActiveRecord questions - by El Forum - 02-19-2009, 10:56 PM
Easy ActiveRecord questions - by El Forum - 02-20-2009, 03:23 AM
Easy ActiveRecord questions - by El Forum - 02-20-2009, 06:31 PM



Theme © iAndrew 2016 - Forum software by © MyBB