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


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)

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.


i am very very new to PHP and MYSQL

I think you've placed you script in the wrong order. You have to place the 'update' before the form being display. For example:

if ($_POST("action")=="true")
  // do something to update your table
  // use subroutine
  // do something to display your form
  // use subroutine

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

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

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.