Jump to content


Photo

refreshing database


  • Please log in to reply
5 replies to this topic

#1 eranwein

eranwein
  • Members
  • PipPip
  • Member
  • 22 posts

Posted 31 March 2006 - 01:01 PM

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?

#2 wildteen88

wildteen88
  • Staff Alumni
  • Advanced Member
  • 10,482 posts
  • LocationUK, Bournemouth

Posted 31 March 2006 - 01:29 PM

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.

#3 craygo

craygo
  • Staff Alumni
  • Advanced Member
  • 1,973 posts
  • LocationRhode Island

Posted 31 March 2006 - 01:34 PM

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

#4 eranwein

eranwein
  • Members
  • PipPip
  • Member
  • 22 posts

Posted 31 March 2006 - 01:36 PM

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

#5 redbullmarky

redbullmarky
  • Staff Alumni
  • Advanced Member
  • 2,863 posts
  • LocationBedfordshire, England

Posted 31 March 2006 - 01:51 PM

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.
"you have to keep pissing in the wind to learn how to keep your shoes dry..."

I say old chap, that is rather amusing!

#6 eranwein

eranwein
  • Members
  • PipPip
  • Member
  • 22 posts

Posted 31 March 2006 - 02:19 PM

gave it a shot. it doesnt work




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users