AJAX ADD & RETRIEVE MYSQL RECORDS USING JQUERY & PHP

Leave a Comment
I love jQuery framework, feels like we can do some awesome things easily. If you are familiar with the basic of jQuery framework too, the next thing you have to do is learn to use jQuery Ajax to add and retrieve records from MySql database. Let’s take a look at how we implement real time add and retrieve records using Ajax.

Database
sample database comment table columns id, name and message



comment.php


process.php

Try to input some comments using that form, here’s what i got



The record i just submitted is successfully added to the database. Although we can’t see right now but it can be checked directly in your MySql.
What is the value of the comment feature of web app if visitors can’t see their own comment. Now, this is our time to be a hero… :D
Edit both files that we have created to add the ability to retrieve records from database.


comment.php
process.php


Now it is more cool with visitor’s comment directly show up after Send Button is clicked



0 comments:

Post a Comment