Jump to content

[SOLVED] Updated information showing previous status


rbastien

Recommended Posts

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

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.

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.