In the previous chapter, we added a global configuration file and configuration files per module. In order to be able to connect to a database, we need to add some lines to our configuration file first.
Let's recall our directory structure:
In order to connect to a database, we need to create it. Create a database named
learning_phalcon. You can do this quickly with the help of the following command line:
$ mysql -u YOURUSERNAME -p -e 'create database learning_phalcon;'
Open the global configuration file (
config/config.php), and add these lines:
'database' => array( 'adapter' => 'Mysql', 'host' => 'localhost', 'username' ...