Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- "Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[28000] [1045] Access
- denied for user 'xxxx'@'localhost' (using password: YES)' in C:wampwwwzendlibraryZendDbAdapterPdoAbstract.php on line 144"
- resources.multidb.db1.adapter = "PDO_MYSQL"
- resources.multidb.db1.dbname = "xxxxx"
- resources.multidb.db1.username = "xxxxxx"
- resources.multidb.db1.password = "xxxxxx"
- resources.multidb.db1.hostname = "localhost"
- resources.multidb.db1.charset = "UTF8"
- resources.multidb.db1.default = true
- resources.multidb.db3.adapter = "PDO_MYSQL"
- resources.multidb.db3.dbname = "xxxxxx"
- resources.multidb.db3.username = "xxxxxx"
- resources.multidb.db3.password = "xxxxxx"
- resources.multidb.db3.hostname = "xxxxx"
- resources.multidb.db3.charset = "UTF8"
- resources.multidb.db3.default = false
- /**
- * Add databases to the registry
- */
- public function _initDbRegistry()
- {
- $this->bootstrap('multidb');
- $multidb = $this->getPluginResource('multidb');
- Zend_Registry::set('local', $multidb->getDb('db1'));
- Zend_Registry::set('db2', $multidb->getDb('db2'));
- Zend_Registry::set('db3', $multidb->getDb('db3'));
- }
- class ModuleName_Model_ModelName extends Zend_Db_Table_Abstract
- {
- protected $_name;
- protected $_schema;
- protected $_db; // changed from $_adapter in tutorial for Zend 1.11
- public function init()
- {
- $this->_name = 'contacts';
- $this->_schema = 'xxxxx';
- $this->_db = Zend_Registry::get('db3');
- }
- }
- $model = new ModuleName_Model_ModelName();
- $this->view->output= $model->fetchAll();
- Zend_Debug::dump($model->getAdapter()->getConfig());
- $model = new ModuleName_Model_ModelName();
- Zend_Debug::dump($model->getAdapter()->getConfig());
Add Comment
Please, Sign In to add comment