|
|||
|
Currently I am using one database for my project, but would want to try connect two database at the same time.
I am using the Adapter factory method with a Zend_Config object as below: // load configuration $config = new Zend_Config_Ini('./application/config.ini', 'general'); Zend_Registry::set('config', $config); // setup database $db = Zend_Db::factory($config->db->adapter,$config->db->config->toArray()); $db->setFetchMode(Zend_Db::FETCH_OBJ); Zend_Db_Table::setDefaultAdapter($db); //default adapter for Zend_DB_Table extend class Zend_Registry::set('mydb', $db); //store the adapter for global use But I can't write my code right to connect two database. Please advice ![]() |
|
|||
|
You can just instantiate another Zend_Db object.
PHP Code:
Last edited by jasonw : 05-22-2008 at 03:36 AM. |
![]() |
| Thread Tools | |
| Display Modes | |
|
|