Jump to content

PHP/MySQL database updates unavailable after Back button.


nonstop
 Share

Recommended Posts

Hey folks.I have scanned the net for days trying to find anyone else discussing this problem, with no luck.I felt certain that it must be a common problem, but maybe not. In a nutshell:1) insert a record into table Z from script A;2) count(*) on table Z says 1 record (correct);3) link to script B via form submit, method post;4) insert a record into table Z from script B;5) count(*) on table Z says 2 records (correct);6) hit Back button;7) count(*) on table Z says 1 record (incorrect). If I link back to script A, rather than use the Back button, then count(*) says 2 records as it should.If I wait long enough before pressing the Back button (10 minutes) then script A, count(*), says 2 records. This is happening regardless of whether I use mysql_connect or mysql_pconnect. It is also happening regardless of whether or not mysql_close (or mysql_commit) is issued after each insert. As I have read many times recently, the Back button is not your friend. Thanks in advance for any help you can offer.

Link to comment
Share on other sites

The back button doesn't necessarily cause the browser to get the page from the server again, in this case it is loading the page from your local cache and showing whatever you downloaded the first time you went there. That's the normal behavior for the back button.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...