Problem is:
I click my submit button it updates the database but not the website content, I click the submit button again and it updates the website content this time.

This problem always pops up, and its due to incorrect structure of code in most parts :(

I cant seem to remember what structure I should have my code set out to (updates, selects, etc and in which order) - as it seems complex yet correct.

So anyone lead me in the right direction? Thanks

PS: I use the below code to refresh the page:

header('refresh: 0; url=test.php');
9 Years
Discussion Span
Last Post by OmniX

try it like this

   $query = "your update query";
   $result = mysql_query($query);
       header("Location: yourpage.php");

after u submit the button, your current page will redirect automatically to yourpage.php


Well I have like 3-4 queries done this one submit button so you want me to try doing that for the last one?

But all queries work so the page should be refreshed either way?

Also I have tried Location, and the same thing happens but worse.


Also for what it matters at the moment I have cut the code and inserted into two submit buttons and works fine.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.