| | |
Updating required 2 Clicks of the same button
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
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:
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:
PHP Syntax (Toggle Plain Text)
header('refresh: 0; url=test.php');
•
•
Join Date: Jan 2008
Posts: 79
Reputation:
Solved Threads: 9
try it like this
after u submit the button, your current page will redirect automatically to yourpage.php
PHP Syntax (Toggle Plain Text)
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
![]() |
Other Threads in the PHP Forum
- Previous Thread: sending radio button to database
- Next Thread: Cutting amount of work and loading time?
| Thread Tools | Search this Thread |
apache api array basic beginner binary broken cache cakephp checkbox class cms code computing confirm cron curl customizableitems database date delete display dynamic echo email error external file files filter folder form forms forum function functions gc_maxlifetime google headmethod host howtowriteathesis href htaccess html iframe image include insert ip javascript joomla limit link login mail malfunction memmory memory menu mlm multiple mysql navigation oop parsing paypal pdf php phpmysql problem query question radio random recursion remote script search select server sessions sms snippet source space sql syntax system table thesishelp trouble tutorial update upload url validator variable video web youtube





