Jump to content

database will not refresh after updating database unless browser is restarted


Recommended Posts

Hi

I am making a php based website in which i can allow users to make accounts. The users are provided with an EDIT PROFILE details page. When i edit the profile, and update the database, the changes do not show until i logout and login again. HELP

I have a website that allows users to make accounts with user profiles. So once he is logged in, he has an option to edit his profile. He clicks on the edit profile link that directs him to edit.php. This page provides him with a simple form. Once the form is filled, the database is updated. IT WORKS FINE TILL HERE.

Now the issue is that after the form is filled, i redirect the user to the "loginsuccess.php" which is the profile page. But the NEW CHANGES TO THE PROFILE  DONT SHOW on the profile.

But once the user logs out and logs in again, THE CHANGES APPEAR.

Why dont the changes show immediately? Why do i have to logout and login again?

 

 

Sounds like you probably have the user data stored within the session, but are not updating it when you update the database. If that's not the problem or you're unsure, you'll need to the relevant code.

How does the profile page retrieve data? Does it grab from a cache or use data that was in the session like Adam suggested?  You say your profile edit page is edit.php, is that doing the form processing or is loginsuccess.php?  If loginsuccess.php is doing form processing is it retrieving the profile view data before or after the profile table is updated with the processed form data?

sahil123, you're going to need to provide us with more information than that. Is the data cached? If it is, that will explain why you're still seeing the old (cached) data after you've made the update. Posting the *relevant* code would be helpful if you don't fully understand what we're asking.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.