Category: Phalcon
-
Good way to connect database in Phalcon php framework
Database connection settings can be done by registering services in the container. Here is how we can connect a postgresql database use Phalcon\DI; use Phalcon\Db\Adapter\Pdo\Postgresql as DbAdapter; /** * We can move this config is a separate config file */ $config = new \Phalcon\Config(array( ‘database’ => array( ‘adapter’ => ‘Postgresql’, ‘host’ => “localhost”, ‘username’ =>…