I'm currently using only one database with Zend Framework, but now I have to add ONE MORE.
I'm using this code right now:
public static function setupDatabase()
{
$config = self::$registry->configuration;
$db = Zend_Db::factory($config->db->adapter, $config->db->toArray());
$db->query("SET NAMES 'utf8'");
self::$registry->database = $db;
Zend_Db_Table::setDefaultAdapter($db);
}
What code do I need to write in order to use ONE MORE database; and how I will reference it, when I need to make some queries or so..
This is included in the framework as Zend_Application_Resource_Multidb
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With