Re: db_dataobject and multiple databases
| From: | Ian Warner | Date: | Wed, 18 Oct 2006 19:26:25 +0000 |
| Subject: | Re: db_dataobject and multiple databases | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-25534@lists.php.net to get a copy of this message | ||
Matthew Deir wrote:
Hi, I'm having difficulty getting db_dataobject setup correctly with multiple databases that contain tables with the same name. I'm using createTables.php to generate the classes but of course only one file is created for the table that appears in several databases. Has anyone run into anything similar? Any guidance is appreciated.Info is here 3/4s down http://pear.php.net/manual/en/package.database.db-dataobject.intro-configuration.php Please send some code of what you are doing now, are you using ini? Array? ie i think this is how you do it if i remember schema and all other stuff are in the one place hope that helps: // Create the array of options for DataObjects $config['DB_DataObject'] = array(
'database_admin' => 'mysqli://USER:PASS@localhost/admin', 'database_other' => 'mysqli://USER:PASS@localhost/other','schema_location' => ADMIN_DO . 'admin/schema', 'class_location' => ADMIN_DO . 'admin', 'require_prefix' => ADMIN_DO . 'admin',
'class_prefix' => 'DO_', 'db_driver' => 'MDB2','extends_location' => ADMIN_DO . 'admin/Inter.php',
'extends' => 'DB_Inter');$options = &PEAR::getStaticProperty('DB_DataObject', 'options'); $options = $config['DB_DataObject'];
Thanks, Matt.