Guest User

Untitled

a guest
Jul 14th, 2018
164
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.68 KB | None | 0 0
  1. "Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[28000] [1045] Access
  2. denied for user 'xxxx'@'localhost' (using password: YES)' in C:wampwwwzendlibraryZendDbAdapterPdoAbstract.php on line 144"
  3.  
  4. resources.multidb.db1.adapter = "PDO_MYSQL"
  5. resources.multidb.db1.dbname = "xxxxx"
  6. resources.multidb.db1.username = "xxxxxx"
  7. resources.multidb.db1.password = "xxxxxx"
  8. resources.multidb.db1.hostname = "localhost"
  9. resources.multidb.db1.charset = "UTF8"
  10. resources.multidb.db1.default = true
  11.  
  12. resources.multidb.db3.adapter = "PDO_MYSQL"
  13. resources.multidb.db3.dbname = "xxxxxx"
  14. resources.multidb.db3.username = "xxxxxx"
  15. resources.multidb.db3.password = "xxxxxx"
  16. resources.multidb.db3.hostname = "xxxxx"
  17. resources.multidb.db3.charset = "UTF8"
  18. resources.multidb.db3.default = false
  19.  
  20. /**
  21. * Add databases to the registry
  22. */
  23. public function _initDbRegistry()
  24. {
  25. $this->bootstrap('multidb');
  26. $multidb = $this->getPluginResource('multidb');
  27. Zend_Registry::set('local', $multidb->getDb('db1'));
  28. Zend_Registry::set('db2', $multidb->getDb('db2'));
  29. Zend_Registry::set('db3', $multidb->getDb('db3'));
  30. }
  31.  
  32. class ModuleName_Model_ModelName extends Zend_Db_Table_Abstract
  33. {
  34. protected $_name;
  35. protected $_schema;
  36. protected $_db; // changed from $_adapter in tutorial for Zend 1.11
  37.  
  38. public function init()
  39. {
  40. $this->_name = 'contacts';
  41. $this->_schema = 'xxxxx';
  42. $this->_db = Zend_Registry::get('db3');
  43. }
  44. }
  45.  
  46. $model = new ModuleName_Model_ModelName();
  47. $this->view->output= $model->fetchAll();
  48.  
  49. Zend_Debug::dump($model->getAdapter()->getConfig());
  50.  
  51. $model = new ModuleName_Model_ModelName();
  52. Zend_Debug::dump($model->getAdapter()->getConfig());
Add Comment
Please, Sign In to add comment