Live coding with PDO / MVC and form with errors handling
-
Connect to mysql with your username and your password and create a new database:
mysql -u USERNAME -p
- Write your password
CREATE DATABASE nameDatabase;
exit;
-
Import the database with the commande line:
mysql -u username -p nameDatabase < dump.sql
-
Go to the project
cd ~/path_to_my_project
-
Rename
connect.php.dist
>>connect.php
-
Go to your project and configure the variables:
$db_name
(Same name when creating the database)$db_username
$db_password
-
Do
composer install
to install dependancies -
Start your server
php -S localhost:8000 -t public/
Enjoy ;)