phalconeye

How to connect multiple database in phalcon framework

荒凉一梦 提交于 2020-01-02 07:52:07
问题 i have to database namely master and xyz ,in that i required to connect both database in application . so is it possible to connect multiple database in one application and yes then how.? 回答1: Set your connections in DI: //This service returns a MySQL database $di->set('dbMaster', function() { return new \Phalcon\Db\Adapter\Pdo\Mysql(array( "host" => "localhost", "username" => "", "password" => "", "dbname" => "" )); }); //This service returns a PostgreSQL database $di->set('dbSlave',

How to connect multiple database in phalcon framework

别来无恙 提交于 2019-12-05 18:50:12
i have to database namely master and xyz ,in that i required to connect both database in application . so is it possible to connect multiple database in one application and yes then how.? Set your connections in DI: //This service returns a MySQL database $di->set('dbMaster', function() { return new \Phalcon\Db\Adapter\Pdo\Mysql(array( "host" => "localhost", "username" => "", "password" => "", "dbname" => "" )); }); //This service returns a PostgreSQL database $di->set('dbSlave', function() { return new \Phalcon\Db\Adapter\Pdo\Mysql(array( "host" => "localhost", "username" => "", "password" =>