DataTables CRUD Operations using PHP, jQuery & MySQL

CRUD Operations heart of a dynamic application. CRUD stands for Create, Read, Update and Delete and these are four basic functions to manipulate data in a database. In this tutorial, you will learn how to implement DataTables CRUD Operations using PHP jQuery, and MySQL. We will cover this tutorial in easy steps with live demo to DataTables CRUD Operations using PHP, jQuery & MySQL.
  • CREATE – INSERT record in database.
  • READ – read records from database.
  • UPDATE – Executes an UPDATE record in database
  • DELETE – delete specified records from databse.
So let’s implement TinyMCE Editor Upload Image with PHP. look following folder and file structure:
  • tinymce-upload-image-with-php-ajax
    • assets
      • css
        • style.css
      • js
        • ajax.js
    • templates
      • header.php
      • footer.php
    • modal
      • add.php
      • view.php
    • index.php
    • action.php
Step 1: Create MySQL Database Table
First, we will create database with the following table.
Step 2: Include the DataTables script(JS and CSS)
Step 3: Display Student List
In index.php, we will create Bootstrap table to display student records.
In ajax.js, we will make ajax request to action.php to action student-list to load student data to Datatables.
Step 4: Database Connection class
Create a class file named DBConnection.php inside “class/” folder.
Step 5: Create a class file named Student.php inside “class/” folder.
Manage CRUD Operations
Create action file named action.php
Manage request and return as JSON data
Step 6 : Add and View Student Record
We will design Bootstrap modal to add, view and update student record.
add.php inside “modal/” folder
view.php inside “modal/” folder
Complete HTML file named index.php
Complete jQuery file named ajax.js
Handle crud proccess
Create header.php and footer.php section of the webpage. The Bootstrap library is used to provide a better UI, so, include it in the header and footer section.
header.php
footer.php