I'm planning to do a "training mode" to my system. When it's activated, the systems database connection would get table users
from the database 1 but tables customers
and products
from the database 2.
What would be the best way to do this? I have following database connection (using PDO).
$pdo = new PDO(DB_TYPE.':host='.DB_HOST.'; dbname='.DB_NAME, DB_USER, DB_PASS);
The system looks for training mode status from users
and if it's true, it should connect another database's customers
and products
. Can I get some of the tables from one database and some of the other?