We connect the front-end with the backend i.e. database. To access the database we required username and password. Below we connect to the database name: javatpoint and defining configuration file.
Example
<?php
// Required
$config = [
'host' => '127.0.0.1',
// Optional
$config['persistent'] = false;
// Create a connection
$connection = new \Phalcon\Db\Adapter\Pdo\Mysql($config);
'username' =>'siddharth',
'password' =>'flash',
'dbname' => 'javatpoint',
];
Output:
Leave a Reply