Solved

modify one value without refreshing the page

Posted on 2013-05-31
3
408 Views
Last Modified: 2013-06-01
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
0
Comment
Question by:rgb192
3 Comments
 
LVL 7

Accepted Solution

by:
Robert Saylor earned 250 total points
ID: 39211457
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.
0
 
LVL 109

Assisted Solution

by:Ray Paseur
Ray Paseur earned 250 total points
ID: 39211495
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.
http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Jquery/A_10712-The-Hello-World-Exercise-with-jQuery-and-PHP.html

For a better understanding of HTTP client/server protocols, this article might be helpful.
http://www.experts-exchange.com/Web_Development/Web_Languages-Standards/A_11271-Understanding-Client-Server-Protocols-and-Web-Applications.html
0
 

Author Closing Comment

by:rgb192
ID: 39213344
thank you
0

Featured Post

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

These days socially coordinated efforts have turned into a critical requirement for enterprises.
This article discusses four methods for overlaying images in a container on a web page
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

776 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question