Queries across multiple databases with CakePHP
Friday, November 27th, 2009Most CakePHP documentation assumes you’ll be working with tables in the same database. However, how do you query related data when your tables are spread across multiple databases? Fortunately, CakePHP makes this a breeze with the CakePHP model’s ‘useDbConfig’ variable and a little table prefix manipulation I picked up from this post in the CakePHP Google group.
Before the detailed explanation, you can view a working demo. Please note, this demo assumes you have basic knowledge of Cake models and associations.







