954,600 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Refresh Form to Display changes

Hi,

i am using mysql and php.

i was wondering if anyone can help me. when customers login a form with thier details which are stored in the mysql database are displayed. when they change a detail such as their address and click on the update button their details are changed in the database but the field in the form changes back to what was there before the update.

Does anyone know how to make it so that it will display their new updated details without having to log out and log back in again.

Thanks in advanced

Scoobie

scoobie
Newbie Poster
20 posts since Jan 2005
Reputation Points: 10
Solved Threads: 0
 

We would need more information... try closing the session and creating a new one (or if you use cookies renew them with the new information)

paradox814
Posting Whiz
351 posts since Oct 2004
Reputation Points: 13
Solved Threads: 4
 

i don't use sessions or cookies. when the user enters their username and password and click submit on the html form it calls a script that finds their details and displays them back in a form. also in the script is an update query that runs when they click the update button. if i click on the update button twice then i see the changes they made in the form but the database reverts back to the old details.

if there is anymore info that i can give please let me know.

Scoobie,

P.S.
i am very very new to PHP and MYSQL

scoobie
Newbie Poster
20 posts since Jan 2005
Reputation Points: 10
Solved Threads: 0
 

I think you've placed you script in the wrong order. You have to place the 'update' before the form being display. For example:
[php]
if ($_POST("action")=="true")
{
// do something to update your table
// use subroutine
}
else
{
// do something to display your form
// use subroutine
}[/php]

zippee
Posting Whiz in Training
294 posts since Jan 2005
Reputation Points: 10
Solved Threads: 7
 

Yep, and then the update will take place before the new data is outputted.

Gary King
PHP/vBulletin Guru
Team Colleague
417 posts since Nov 2003
Reputation Points: 53
Solved Threads: 5
 

no i want to display the data on file first then allow them enter changes and redisplay the form with updated data.

scoobie
Newbie Poster
20 posts since Jan 2005
Reputation Points: 10
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You