Hi im trying to use ORM multiple databases, but i cant get it to work.
In my config.php file i have:
//Default
$db = new fDatabase('mysql', 'dbname', 'user', 'pass');
fORMDatabase::attach($db);
//new instance
$db2 = new fDatabase('mysql', 'dbname_2', 'user_2', 'pass_2');
fORMDatabase::attach($db2, 'newdb');
fORM::mapClassToDatabase('User', 'newdb');
I have my class (user.php):
class User extends fActiveRecord {
protected function configure() {}
}
then when I try to use:
$user = new User();
It throws this error: Uncaught exception 'fProgrammerException' with message 'The table specified, users, does not exist in the database
Any help would be useful
Thanks