/ Published in: PHP

Goes in /Application/Bootstrap.php
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
protected function _initDb() { /* Assuming your config contains the following: database.adapter = [Adapter type], for MySQL = Pdo_Mysql database.host = [Host URL] database.username = [Username] database.password = [Password] database.dbname = [DBName] */ $config = Zend_Registry::get('config'); 'host' => $config->database->host, 'username' => $config->database->username, 'password' => $config->database->password, 'dbname' => $config->database->dbname )); Zend_Db_Table_Abstract::setDefaultAdapter($db); Zend_Registry::set('db', $db);
Comments
