sahil123 Posted March 2, 2012 Share Posted March 2, 2012 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 Quote Link to comment https://forums.phpfreaks.com/topic/258090-database-will-not-refresh-after-updating-database-unless-browser-is-restarted/ Share on other sites More sharing options...
thehippy Posted March 2, 2012 Share Posted March 2, 2012 You're going to have to explain your design more, tell us what you're using, generally give more details and/or give us some code. Quote Link to comment https://forums.phpfreaks.com/topic/258090-database-will-not-refresh-after-updating-database-unless-browser-is-restarted/#findComment-1323065 Share on other sites More sharing options...
sahil123 Posted March 2, 2012 Author Share Posted March 2, 2012 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? Â Â Quote Link to comment https://forums.phpfreaks.com/topic/258090-database-will-not-refresh-after-updating-database-unless-browser-is-restarted/#findComment-1323090 Share on other sites More sharing options...
Adam Posted March 2, 2012 Share Posted March 2, 2012 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. Quote Link to comment https://forums.phpfreaks.com/topic/258090-database-will-not-refresh-after-updating-database-unless-browser-is-restarted/#findComment-1323150 Share on other sites More sharing options...
sahil123 Posted March 2, 2012 Author Share Posted March 2, 2012 Hi Adam, My database is getting updated. That is not the issue. But i have to logout and login again for the changes to appear on the profile page. Quote Link to comment https://forums.phpfreaks.com/topic/258090-database-will-not-refresh-after-updating-database-unless-browser-is-restarted/#findComment-1323159 Share on other sites More sharing options...
thehippy Posted March 2, 2012 Share Posted March 2, 2012 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? Quote Link to comment https://forums.phpfreaks.com/topic/258090-database-will-not-refresh-after-updating-database-unless-browser-is-restarted/#findComment-1323196 Share on other sites More sharing options...
sahil123 Posted March 3, 2012 Author Share Posted March 3, 2012 The edit.php is doing the form processing. loginsuccess.php is just displaying the records. Quote Link to comment https://forums.phpfreaks.com/topic/258090-database-will-not-refresh-after-updating-database-unless-browser-is-restarted/#findComment-1323507 Share on other sites More sharing options...
Adam Posted March 3, 2012 Share Posted March 3, 2012 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. Quote Link to comment https://forums.phpfreaks.com/topic/258090-database-will-not-refresh-after-updating-database-unless-browser-is-restarted/#findComment-1323523 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.