Solved

modify one value without refreshing the page

Posted on 2013-05-31
3
398 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 6

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 108

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

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
session dropped in IE 10 20
gif animation 6 19
sql sentence 2 12
Angular - where do I need to put this code? 3 10
I found this questions asking how to do this in many different forums, so I will describe here how to implement a solution using PHP and AJAX. The logical flow for the problem should be: Write an event handler for the first drop down box to get …
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
The viewer will learn how to dynamically set the form action using jQuery.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

706 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now