Click here to Skip to main content
11,492,691 members (49,071 online)
Rate this: bad
Please Sign up or sign in to vote.
See more: Java Homework script
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 23:19pm
Edited 30-Nov-12 23: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
0 Sergey Alexandrovich Kryukov 454
1 Maciej Los 286
2 F-ES Sitecore 224
3 KarstenK 210
4 CPallini 208
0 Sergey Alexandrovich Kryukov 10,062
1 OriginalGriff 8,620
2 Sascha Lefèvre 3,609
3 Maciej Los 3,372
4 Richard Deeming 2,500

Advertise | Privacy | Mobile
Web01 | 2.8.150520.1 | Last Updated 1 Dec 2012
Copyright © CodeProject, 1999-2015
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