Flourish PHP Unframework
This is an archived copy of the forum for reference purposes

fDatabase + fORMDatabase + mapClassToDatabase - having 2 databse instances mixes the tables?

posted by slikr 9 years ago

I have the following code:


$newDb	= new fDatabase('mysql', 'new_db', 'usr', 'pw', 'same.host');
$connected = $newDb->getConnection();
$oldDb	= new fDatabase('mysql', 'old_db', 'usr', 'pw', 'same.host');
$connected2 = $oldDb->getConnection();

fORMDatabase::attach($newDb);
fORMDatabase::attach($oldDb, 'old');

fORM::mapClassToDatabase('User', 'old');

When trying to do anything with the database I get error exceptions that user table does not exist. I noticed this happens when I am connecting to 2 databases on the same host. If i connect to two-different hosts i dont get this issue.

Can you post a list of tables for each database and the code that is causing the exception to be thrown?

posted by wbond 9 years ago

This should be fixed in r890.

posted by wbond 9 years ago