Category: DataBase

Add, edit, and delete functionality mostly requires on every dynamic based web project.

With AJAX you can improve user experience and do these operations without page reload.

For this, I am using Axios package.

In this tutorial, I show how you can select, insert, update, and delete records from MySQL database with Vue.js and PHP.

Insert Update and Delete records from MySQL with Vue.js

AJAX DataBase PHP Vue.js

Data selection is one of the basic requirement when creating a dynamic website.

Mainly data is fetched from the database on page refresh but for without page refresh require to send AJAX request.

I am using Axios package to send AJAX request.

In this tutorial, I show how you can fetch records from MySQL database using Vue.js and PHP with Axios package.

Fetch records from MySQL Database with Vue.js and PHP

AJAX DataBase PHP Vue.js

Date filter makes easier to list records according to specific date range selection.

The user can pick dates and search the list. Records will be displayed according to date selection.

To add datepicker you can use jQuery UI, Bootstrap, or any other jQuery plugin.

In this tutorial, I am using jQuery UI to add datepicker widget and filter the records with PHP MySQL.

jQuery Datepicker to filter records with PHP MySQL

DataBase PHP

AJAX based pagination load content without reloading the whole webpage and improve the user experience.

CodeIgniter has the pagination library to add pagination.

From the controller need to handle the AJAX request which sends from the view.

In this tutorial, I show how you can create AJAX pagination in CodeIgniter.

How to Create AJAX Pagination in CodeIgniter

AJAX CodeIgniter DataBase How To JQuery PHP

Pagination gets complicated when to find specific groups of records when there is a large number of records are available.

By adding a search filter with pagination makes easier for the user to easily find records e.g. filter list by country, department, name etc.

It is easier to add pagination using pagination library in CodeIgniter.

In this tutorial, I am using the SESSION to store search value and filter the pagination list.

Pagination with search filter in CodeIgniter

CodeIgniter DataBase PHP

It is time-consuming to delete records one by one from the list.

To make deletion process easier for the users by allowing them to select multiple records using checkboxes.

Execute delete query according to the selected checkboxes.

In the demonstration, I am displaying records from the MySQL database table and add a checkbox on each row. Use single submit button to delete selected records with PHP.

Delete multiple selected records with PHP

DataBase PHP

If there is the registration form on the website then you need to make sure that the username or email must be unique.

The user will login with the selected username next time when it comes to the website.

You can either check it after submitting the form or while entering it.

In the demonstration, I am creating a simple registration form in CodeIgniter where check the entered username with Angular and insert the record if the username is available.

Live username availability check with AngularJS in CodeIgniter

AngularJS CodeIgniter DataBase PHP