Welcome Guest, Not a member yet? Register   Sign In
Two Databases in one query using Active Record
#1

[eluser]Unknown[/eluser]
I have two databases.
On db_one, I have a table which only have two columns, a primary_key and a foreign key.
On my db_two, I have a table which have two columns also, a primary_key and name_of_person columns.
The foreign_key on my db_one matches that of the primary_key of db_two.
How should I make my queries so that, I can get all the names on my db_two.name_of_person column with a set(could be list/array) of values(int) that matches some values on my db_one.primary_key?

I have tried several searches on the web and read about using a database name as prefixes on tables but I can't figure out how to have this done using Active Record.

Can this be done?
If not, can this be done in any other way without using Active Record?

I'm fairly new to Codeigniter so please bear with me.
#2

[eluser]CroNiX[/eluser]
Is there a reason why you aren't using a single normalized database with 2 tables?




Theme © iAndrew 2016 - Forum software by © MyBB