Mysql db stores todos of user, using ajax for GET/POST. Mysql needs connected before runing this app.
Create an empty database first like say todos
and then you can generate dummy data by running file localhost/todo-jquery-php-mysql/includes/dump-sql.php
in your browser as mentinoned below -
- user (id, first_name, last_name, email)
- todo (id, user_id, title, completed, date_time)
- Edit file
localhost/todo-jquery-php-mysql/includes/db-config.php
file and change constant DB_NAME, DB_USER, DB_PASSWORD, DB_HOST
After successful connection you can use follwing file to create a dummy database using follwing steps
- Edit file
/includes/dump-sql.php
and change sql quries as you want. - Type in browser
localhost/todo-jquery-php-mysql/includes/dump-sql.php
- Hit enter
- There is an option for you to use browser local storage instead of db
To use local storage -
- by default
var useLocalStorage = true;
- Edit file
/js/app.js
and change variableuseLocalStorage
value totrue/false
. - thats it!!!
To run on local try with mamp/xampp/wamp/lamp...etc software
- Start php server
- Start mysql server
- Place downloaded
todo-jquery-php-mysql
folder inwww/htdocs
web directory - Type in browser
localhost/todo-jquery-php-mysql
- Hit enter
- Thanks to TodoMVC for creating jquery version of Todo.
- Thanks to Micah Carrick for PHP MySQL Database Class.