Jump to content

Archived

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

eranwein

refreshing database

Recommended Posts

i have a function that adds a record to a table and then redirects the user to a different page where he should see all of the table's records, including the one that was just added.

the problem is that the second page shows all of the records except the one that was just added.

after a lot of testings, i've tried to manualy refresh the database (mysql-front). after i did that, i've refreshed my page and lost record was found.

is that the way it suppose to be?
if so, is there a function in php that refreshes the database?

Share this post


Link to post
Share on other sites
How do you redirect the user to the page that shows the tables records? If you are using a link or a header redirect then the mysql database should show all the data in the table, including new ones.

PHP doesn't have a function that can refresh the database. However MySQL does cache the queries prehaps if you use [a href=\"http://uk2.php.net/manual/en/function.mysql-free-result.php\" target=\"_blank\"]mysql_free_result()[/a] it may solve this.

Share this post


Link to post
Share on other sites
I know what you are talking about. It seems like the page is cached and when you go back to it, you see the records that were there the last time you were on the page. I am not sure what it is but I will be looking for it today. Will post when I find out.

Ray

Share this post


Link to post
Share on other sites
it's a submit() function that operates "post" method and it's action is the addres of the other page.

Share this post


Link to post
Share on other sites
if you have a look at [a href=\"http://www.php.net/mysql_free_result\" target=\"_blank\"]http://www.php.net/mysql_free_result[/a] and some of the user comments, you'll possibly find that wildteen88's suggestion to use mysql_free_result is spot on.

Share this post


Link to post
Share on other sites

×

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.