modify one value without refreshing the page

using jquery,ajax, php, mysql

$first_name=mysql_query('select first_name from users');

foreach ($first_name as $fn){
echo $fn['first_name']

is there a way to modify first_name (one field, one row) and save to the database without refreshing the page
Who is Participating?
Robert SaylorConnect With a Mentor Senior DeveloperCommented:
yes but you would have to put each field in it's own div tag then call ajax. I use prototype and have done this before. It's a lot of code because if you have multiple columns you would be creating a lot of php code to update each field.
Ray PaseurConnect With a Mentor Commented:
The part about "without refreshing the page" is relatively easy using jQuery and AJAX.  This article shows the basics of jQuery/AJAX.  It takes an input value (which could easily be prepopulated by a script on the server) and sends it to the AJAX script.  This is done with JavaScript (jQuery) without using an HTML form.  The server-side AJAX script simply regurgitates what it got in the AJAX request, but it could easily update the data base.

For a better understanding of HTTP client/server protocols, this article might be helpful.
rgb192Author Commented:
thank you
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.