Click here to Skip to main content
13,004,215 members (80,389 online)
Rate this:
Please Sign up or sign in to vote.
See more:
Code with comments would be highly appreciated

A developer wants to update a database and display a message to the user without refreshing the page. He is essentially going to use AJAX. Suppose you have the following PHP code snippet that queries a MYSQL database and is stored at
mysql_query("UPDATE table_name WHERE column_name = ‘$var’") ;
echo "Database successfully updated" ; 

Make an AJAX request (JQuery if you want) to retrieve data from the URL above.
Change a div element with ID = “message” to the response of the AJAX call.
Posted 30-Nov-12 22:19pm
Updated 30-Nov-12 22:23pm

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

This looks like homework.

It would be best if you did your own homework. It is given to you so that you will learn something, think about what have been taught. Read your text books and give it a try.

Once you have code and run into problems you can always come back here with a more specific question and the community will do its best to help you. Don't forget to post only the relevant code bits that pose the problem as a code dump is not usually helpful at all in getting someone to help/assist you.

Good luck and happy coding.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.170627.1 | Last Updated 1 Dec 2012
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100