Alex Netkachov wrote:
Hi Ian,
I believe you need to use either $config->db->__set('dbname',
'somename'); or $config->db->dbname = 'somename'; but not
$config->__set('db.host', ' 127.0.0.1 <http://127.0.0.1>');
Sincerely,
Alex
Spot on my friend, thank you very much.
Should include this little snippet in the docs or wtihin the code block
Cheers
Ian
On 4/17/07, *Ian Warner* <[EMAIL PROTECTED]
<mailto:[EMAIL PROTECTED]>> wrote:
I have the following code
Allow modifications is set to on so should be ok.
But the SET does not seem to be working.
Maybe cause what I need to set is an array?
// Loop through the databases
foreach ($databases as $k => $v) {
$config->__set(' db.dbname', $v['Database']);
$db = Zend_Db::factory($config->db_adapter,
$config->db->asArray());
Zend_Debug::dump($config->db, 'Config', true);
// Query to retrieve the tables within the database
$sql = $db->query('SHOW TABLES');
$tables = $sql->fetchAll();
Zend_Debug::dump($tables, 'Tables', false);
}
db.host = localhost
db.username = root
db.password =
db.dbname = admin
db.profiler = true
db.useSQL = false
db_adapter = PDO_MYSQL
--
Alex
http://www.alexatnet.com/ - Blog and CMS created with Zend Framework and
Ajax.