Documentations

Config DB

By default, Voila uses the SQLite database manager which stores the database in the project's SQLite folder.

If you prefer to use Mysql, you must create a database in your mysql.

If you have access to your database from the command line, with root user or with user benefiting from database creation profiles, just run the commands:

$ mysql -u root -p

And in mysql create your database and fill it with the mvcvoila_items.sql file for example.

Here is an example with the commands to run from the command line in mysql:

CREATE DATABASE my_voila_app;
USE my_voila_app;
SOURCE mvcvoila_items.sql;
QUIT;

Now, you have to configure the config/db.php file.

define('app_db', "sqlite");
// define('app_db', "mysql");
/** * this file define mysql bd access infos. * */
define('app_db_user','user');
define('app_db_pwd','password');
define('app_db_host', 'localhost');
define('app_db_name', 'database_name');
/** * this section define sqlite access */
define('app_db_path', __dir__ . '/../sqlite/mvcvoila.com.db');

and you replace user, password and database_name with you local data for mysql

Don't forget to comment "define('APP_DB', "sqlite");" and uncomment "// define('APP_DB', "mysql");"

Let's try if it's working on your browser (don't forget to launch your web server)