Welcome Guest, Not a member yet? Register   Sign In
Active Record - Join a table twice
#2

[eluser]Stefan Hueg[/eluser]
As every contacts-table has the same column names (and they overwrite each other), you have to specify aliases, like this:

Code:
$this->db->select('customers.*, contacts.contact_id as c_contact_id, salesmen.contact_id as s_contact_id, ....);

And do this with every field.


Messages In This Thread
Active Record - Join a table twice - by El Forum - 05-01-2012, 11:30 AM
Active Record - Join a table twice - by El Forum - 05-01-2012, 11:47 AM



Theme © iAndrew 2016 - Forum software by © MyBB