Created
July 10, 2015 11:01
-
-
Save italoveloso/0519377c9766f15b45f6 to your computer and use it in GitHub Desktop.
Conexão banco de dados Zend Framework 1 direto no Bootstrap.php
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$db = new Zend_Db_Adapter_Pdo_Mysql(array( | |
'host' => '127.0.0.1', | |
'username' => 'root', | |
'password' => '', | |
'dbname' => 'database_name' | |
)); | |
// $db = Zend_Db::factory($config->db->adapter, $config->db->config->toArray()); | |
Zend_Db_Table_Abstract::setDefaultAdapter($db); | |
$db->setFetchMode(Zend_Db::FETCH_OBJ); | |
Zend_Registry::set('db',$db); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment