Solved

modify one value without refreshing the page

Posted on 2013-05-31
3
410 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 110

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

MIM Survival Guide for Service Desk Managers

Major incidents can send mastered service desk processes into disorder. Systems and tools produce the data needed to resolve these incidents, but your challenge is getting that information to the right people fast. Check out the Survival Guide and begin bringing order to chaos.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Open dialog with server side controls in it 3 46
Wordpress and Wufoo 1 36
PHP SMTP authentication 6 23
php output utf-8 problem 6 13
Introduction If you're like most people, you have occasionally made a typographical error when you're entering information into an online form.  And to your consternation, the browser remembers the error, and offers to autocomplete your future entr…
These days socially coordinated efforts have turned into a critical requirement for enterprises.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

713 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