Monk3h Posted September 27, 2008 Share Posted September 27, 2008 I am currently working on a new RPG. My problem is that my pages seem to update 1 stage behind the database. When I click a link to change something in the game the effect does not appear until 1 click after. For example, my script will pick up that a player is on a portal location, on doing so a link appears allowing that player to enter the portal. But once the link is clicked for some reason that message still appears! The database is correct and shows the player as in the portal, its not until the link is clicked a second time that the link disappears. Any ideas? I am using $action on links. PHP snippet. if ($stat[location] == '1'){ Print "<br><br>You are currently on a Portal location within the AlphaGrounds, clicking here will allow you to move from this location thru the Portal, this will take an undetermined amount of time.<br><br><center><a href=alphaground.php?action=portal>Click here</a> to enter the Portal.</center>"; } if ($action == portal){ mysql_query("update players set location='0'where id=$stat[id]"); } if ($action == portalback){ mysql_query("update players set location='1'where id=$stat[id]"); } Link to comment https://forums.phpfreaks.com/topic/126067-php-problem/ Share on other sites More sharing options...
Monk3h Posted September 27, 2008 Author Share Posted September 27, 2008 I have solved the problem using a URL redirect script but im hoping some one has a more practical solution. :/ Link to comment https://forums.phpfreaks.com/topic/126067-php-problem/#findComment-651903 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.