Re: DataObject and Username
| From: | Norbert Mocsnik | Date: | Wed, 18 Aug 2004 21:52:38 +0000 |
| Subject: | Re: DataObject and Username | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-14173@lists.php.net to get a copy of this message | ||
Alex Goddard wrote:
Hi, I'm looking for a way to, if a configuration option is set, connect to a database using my own username and password instead of the ones given in the 'database' option of DB_DataObject. [snip]Instead of using ini-files, set up an array. See the _second part_ of Example 26-2. Setting the default options. http://pear.php.net/manual/en/package.database.db-dataobject.intro-configuration.php $options = &PEAR::getStaticProperty('DB_DataObject','options'); $options = array(
'database' => 'mysql://user:password@localhost/vending','schema_location' => '/home/me/Projects/myapplication/DataObjects', 'class_location' => '/home/me/Projects/myapplication/DataObjects', 'require_prefix' => 'DataObjects/',
'class_prefix' => 'DataObjects_',); I generally dislike .ini files--I always use it this way so I can guarantee it works. -- Regards, Norbert Mocsnik http://norbert.mocsnik.hu/ _________________________________ contact me for affordable multi- domain developer hosting packages