0

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');
2
Contributors
3
Replies
4
Views
9 Years
Discussion Span
Last Post by OmniX
0

try it like this

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

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

0

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.

0

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.