Guest User

Untitled

a guest
Feb 11th, 2019
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. require_once 'Zend/Registry.php';
  2. require_once 'Zend/Db/Adapter/Pdo/Mysql.php';
  3.  
  4. // Set the database connection information
  5. $params = array('host' =>'localhost',
  6. 'username' =>'root',
  7. 'password' =>'12345',
  8. 'dbname' =>'testdb');
  9.  
  10. // Assign the database connection to the registry
  11. $db = new Zend_Db_Adapter_Pdo_Mysql($params);
  12. $db->setFetchMode(Zend_Db::FETCH_OBJ);
  13. Zend_Registry::set('db',$db);
  14.  
  15. resources.db.adapter = "pdo_mysql"
  16. resources.db.params.host = "localhost"
  17. resources.db.params.username = "root"
  18. resources.db.params.password = "12345"
  19. resources.db.params.dbname = "testdb"
  20.  
  21. $this->bootstrap('db');
  22.  
  23. $db = Zend_Db_Table::getDefaultAdapter();
Add Comment
Please, Sign In to add comment