The PHP page cannot be refreshed synchronously with the database. my current problems are: (1.php and 2. php is on the left and right sides of the framework. on the php page, add data to the database. the php page displays the database content, but there is no newly added record. add data again. after submission. the php page displays the previously submitted data, but the data submitted this time is not displayed. how can this problem be solved? on the Internet, it is a cache problem, you can add the following code to the php page. However, I have added the code to every page. why is it still useless. Almost Dying
@ Header ('expires: Thu, 01 Jan 1970 00:00:01 GMT ');
@ Header ('last-Modified: '. gmdate ('d, d m y h: I: s'). 'gmt ');
@ Header ('cache-Control: no-Cache, must-revalidate, max-age = 0 ');
@ Header ('pragma: no-cache ');
Reply to discussion (solution)
You are 1. php after submitting data, refresh the entire page, but 2. php is not updated, right?
If it is a cache problem, you can change it to 2.php? in src of framework 2. php? In this way, php will no longer be cached.
For example:
I tried using your method, but I still can't. I was wondering if it was a server-side cache, because after I added a record, the page did not display the newly added record, the added data will only be displayed when the record is added next time. refreshing and force refreshing will not work. what should I do?
I have already found the problem, but I can't help it. it's not a cache issue. before the loop, I first got one more record in the database, that is, mysql_fetch_array ().