Jump to content

PHP Problem.


Monk3h

Recommended Posts

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.