Skip to content
Advertisement

Fetch data from database in php through AJAX,

index.php

First I create a connection with the database, I design table through <td> and <tr>, I create a variable $action to get data through AJAX. I use mysqli_fetch_array to fetch data from the database.

JavaScript

Add.html

JavaScript

view.js

I fetch data from the database. I use the show_all() function after that I call $.ajax, data, url, type, success function. The first time I try to fetch data from the database through AJAX.

JavaScript

Advertisement

Answer

JavaScript
User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement