/todo-jquery-php-mysql

Todo App using jquery, php, mysql

Primary LanguagePHP

ToDo app using jQuery, php, Mysql/browser local storage

demo

Mysql db stores todos of user, using ajax for GET/POST. Mysql needs connected before runing this app.

DB Schema -

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 -

Tables

  1. user (id, first_name, last_name, email)
  2. todo (id, user_id, title, completed, date_time)

DB connection

  • Edit file localhost/todo-jquery-php-mysql/includes/db-config.php file and change constant DB_NAME, DB_USER, DB_PASSWORD, DB_HOST

To create dummy db -

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

Local Storage instead of DB

  • 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 variable useLocalStorage value to true/false.
  • thats it!!!

To run app

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 in www/htdocs web directory
  • Type in browser localhost/todo-jquery-php-mysql
  • Hit enter

Credit

  • Thanks to TodoMVC for creating jquery version of Todo.
  • Thanks to Micah Carrick for PHP MySQL Database Class.