CodeIgniter Forums

Full Version: Two Databases in one query using Active Record
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

El Forum

[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.

El Forum

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