Site icon WDB24

Show data from database on page load using Ajax, Php and jQuery

In this tutorial I am going to discuss how to show data from database on page load. With the help of AJAX we are going to achieve this. I know AJAX is one of the very hot topic for PHP beginners. Because it is using almost in every site. I will use jQuery and its ajax function to trigger ajax.

Also Read:

What I am going to do?

I will create a page that shows customer information in a table. I will achieve this with the help of following steps.


Show data from database Ajax, Php and jQuery

Create Database:

Create Mysql Table:

Insert Records In Mysql Table:

Create HTML:

There is a div with a id customer-data. I will show customer data in customer-data div. ajax-loader.gif is a loader image.

CSS:

jQuery Ajax Code:

Ajax Code:

Exit mobile version