rbastien Posted February 9, 2007 Share Posted February 9, 2007 Hey, I just started with Mysql a few days ago, and I looked around and couldn't find anything in relation to the problem. I have a script that clears the table, and rewrites it with the new values which are displayed on the main.php page. When I see the updated information, it retrieves the information I had previously. If I clear "Authenticated Sessions" in firefox, it shows the new information. Is there a php script that clears it so it updates automatically? Here's where to update: http://www.groundwatermusic.com/phpcheck/panel.php Here's the page with the output: http://www.groundwatermusic.com/phpcheck/main.php and here's the code: input.php <?php $artist = $_POST['artist']; $song = $_POST['song']; $album = $_POST['album']; $connect = mysql_connect("localhost", "xxxxxxx", "xxxxxxxxx") or die(mysql_error()); mysql_select_db("gwdata") or die(mysql_error()); mysql_query("INSERT INTO groundchoice (artist, song, album) VALUES('$artist', '$song', '$album' ) ") or die(mysql_error()); session_cache_limiter('public'); $cache_limiter = session_cache_limiter(); session_cache_expire(0.01); $cache_expire = session_cache_expire(); mysql_close($connection); ?> main.php <?php $session = mysql_connect("localhost", "xxxxx", "xxxxxxxx") or die(mysql_error()); mysql_select_db("gwdata") or die(mysql_error()); $result = mysql_query("SELECT * FROM groundchoice") or die(mysql_error()); $row = mysql_fetch_array( $result ); echo $row['artist']; echo "<br />"; echo $row['song']; echo "<br />"; echo $row['album']; mysql_close($session); ?> Thanks in advance! Rob Link to comment https://forums.phpfreaks.com/topic/37710-solved-updated-information-showing-previous-status/ Share on other sites More sharing options...
btherl Posted February 9, 2007 Share Posted February 9, 2007 Can you give a bit more detail about how you tested the script? Something like this: 1. Entered "blah" into form and clicked submit 2. Observed old data 3. Cleared authenticated sessions 4. Refreshed page etc etc I suspect your problem is either due to caching, or due to selecting data from the database before you have written the updated data. Link to comment https://forums.phpfreaks.com/topic/37710-solved-updated-information-showing-previous-status/#findComment-180419 Share on other sites More sharing options...
rbastien Posted February 9, 2007 Author Share Posted February 9, 2007 Sure 1. Observe old data (eg. "blah") 2. go to panel.php, click the button, and it clears the data. 3. Type in "meh" for all of the forms 4. Go to main.php. Output remains as "blah". 5. Refresh, nothing happens 6. Firefox -> Tools -> Clear Private Data -> Authenticated Sessions 7. Updated information displays Link to comment https://forums.phpfreaks.com/topic/37710-solved-updated-information-showing-previous-status/#findComment-180426 Share on other sites More sharing options...
rbastien Posted February 9, 2007 Author Share Posted February 9, 2007 Fixed it! Thanks for the heads up about the database. I deleted and recreated the table using a different storage type, and it works perfectly Link to comment https://forums.phpfreaks.com/topic/37710-solved-updated-information-showing-previous-status/#findComment-180445 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.