Ajax PHP

How to Delete Data without page refresh in PHP using Ajax

delete data without page refresh in php using ajax

In this article we  are going to show you how to delete data without page refresh in PHP using Ajax. Delete with ensure box, here we have a tendancy to area unit planning to see regarding a way to delete the data while not refreshing page and with confirmation box, and this is often what most of them looking , therefore these days planning to show you that, a way to build this alert box with ajax. i will show you how you can delete table rows from database using PHP and Ajax.  the intersting thing here is that we will be able to delete the rows without refreshing the page and present some animation while deleting those rows. this example we will fetch the data from the database and display the data list with delete button. by this button user can delete data from the database. All operation will happen on a single page without page refresh. Let’s start the step by step guid on How to delete data without page refresh in php using Ajax.

How to Delete Data without page refresh in PHP using Ajax

In today’s post i am planning to share the foremost helpful jQuery functions $.ajax() and $.post , victimization these two functions you will submit the PHP web forms while not refreshing the webpage,

Create Login CRUD System using PHP MySQL

1-Creating Database

  • Open Phpmyadmin in your Browser
  • Click on Database Tab Display on Top side
  • Give the Database name “db_search”.
  • After Creating Database Open it.
  • Click on SQL Tab on Top area
  • Copy the Below Source Code and paste it.
  • Then Click on Go.

OR Import DB File

After Downloading the source code extract it in your root folder.

  • Open Phpmyadmin in your Browser
  • Click on Database Tab Display on Top side
  • Give the Database name “db_search”.
  • After Creating Database Open it.
  • Click on Import Tab on Top area
  • You can Find Db file in  Downloaded source code Select it.
  • Then Click on Go.

Download More Source Code Like

2- Creating Database Connection

After import Database File then next step is creating database connection using php copy the below code and save it is as “database.php”.

3- Creating Header.php

in this step we are going to create header file.

4 – Display Data in table From Databse

in this step we are going to fetch all data from database and display in Table.

5 – Create Javascript Code For Delete without page refresh

You will need some javascript for the event handler for the delete button, handling the response from the server and for attaching the event to the handler perform to the button. My convention once operating with mythical being is to call my function send_ACTION() and recieve_ACTION(), as you will see below..

6 – Delete Data From database using PHP

in this step we are going create a script using php who delete data from database.

If you facing any type of problem with this source code then you can Download the Complete source code in zip Formate by clicking the below button Download Now otherwise you can send Comment.

 

About the author

Deepak

Hi, This is Deepak Raj from Sourcecodesite.com.I am a Web Developer, Blogger, Online Instructor and SEO consultant who has been working online for last 4 years and he is running several successful websites on the internet.

3 Comments

Leave a Comment