Solved

modify one value without refreshing the page

Posted on 2013-05-31
3
414 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

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 how to implement server side field validation and display customized error messages to the client.
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 dynamically set the form action using jQuery.

710 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