eranwein Posted March 31, 2006 Share Posted March 31, 2006 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? Quote Link to comment Share on other sites More sharing options...
wildteen88 Posted March 31, 2006 Share Posted March 31, 2006 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. Quote Link to comment Share on other sites More sharing options...
craygo Posted March 31, 2006 Share Posted March 31, 2006 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 Quote Link to comment Share on other sites More sharing options...
eranwein Posted March 31, 2006 Author Share Posted March 31, 2006 it's a submit() function that operates "post" method and it's action is the addres of the other page. Quote Link to comment Share on other sites More sharing options...
redbullmarky Posted March 31, 2006 Share Posted March 31, 2006 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. Quote Link to comment Share on other sites More sharing options...
eranwein Posted March 31, 2006 Author Share Posted March 31, 2006 gave it a shot. it doesnt work Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.