Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // in your application.ini
- ; database data
- resources.db.adapter = "mysqli" // or pdo_msql
- resources.db.params.username = "username"
- resources.db.params.host = "localhost"
- resources.db.params.dbname = "NameOfDb"
- resources.db.params.password = "UserPassword"
- resources.db.params.charset = "utf8"
- // in your bootstrap to add the db to the registry
- protected function _initDbAdapter() {
- $this->bootstrap('db');
- $db = $this->getResource('db');
- if ($db != null) {
- Zend_Registry::set('db', $db);
- } else {
- throw new Exception('cannot create database adapter');
- }
- Zend_Db_Table_Abstract::setDefaultAdapter($db);
- }
Add Comment
Please, Sign In to add comment