Re: db_dataobject and multiple databases
| From: | Ian Warner | Date: | Wed, 18 Oct 2006 19:46:53 +0000 |
| Subject: | Re: db_dataobject and multiple databases | ||
| References: | 1 2 3 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-25536@lists.php.net to get a copy of this message | ||
Matthew Deir wrote:
HI Ian, Thanks for the quick reply. I'm using an array: $do_options = &PEAR::getStaticProperty('DB_DataObject','options'); $do_options = array(And the errors are ? Turn debugging to 5 If I remember correctly using a database name with an underscore _ in caused issues with the parser for using multi databases ? Try renaming a couple to eliminate this i.e.// 'database' => 'mysql://apache:apache@localhost /mysql', 'database_adv_star' => 'mysql://apache:apache@localhost/adv_star', 'database_adv_massmail' => 'mysql://apache:apache@localhost/adv_massmail','database_adv_mailtracking' => ' mysql://apache:apache@localhost/adv_mailtracking','database_adv_reports' => 'mysql://apache:apache@localhost/adv_reports','database_adv_ats' => 'mysql://apache:apache@localhost/adv_ats','schema_location' => $GLOBALS['framework']['root']."/system/dataobjects", 'class_location' => $GLOBALS['framework']['root']."/system/dataobjects", 'require_prefix' => 'dataobjects/','class_prefix' => 'DO_');
'database_advstar' => 'mysql://apache:apache@localhost/adv_star', 'database_advmassmail' => 'mysql://apache:apache@localhost ,
On 10/18/06, Ian Warner <iwarner@triangle-solutions.com> wrote: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(Thanks, Matt.'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'];