Zend Framework multiple databases

Posted by Uffo on Stack Overflow See other posts from Stack Overflow or by Uffo
Published on 2010-05-30T14:48:21Z Indexed on 2010/05/30 14:52 UTC
Read the original article Hit count: 229

Filed under:
|
|
|

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..

Best Regards!

© Stack Overflow or respective owner

Related posts about php

Related posts about mysql