Display new data on same page without refreshing

I’m trying to show the same data, but updated right away. For example. I want to update my coords on a map and refresh a div to show the new data, but as the code now, it keeps the same data until I reload the page. Here is the code I have now…

[PHP]if ($north)
{$ylocation = $users[‘y’] + 1;
if ($ylocation > 5)
{
$ylocation = 0;
}
$locationyupdate = (“UPDATE players SET y = ‘$ylocation’ WHERE name=’$users[name]’”);
mysql_query($locationyupdate) or die(“could not register”);?>

<?}[/PHP] The update code is before the reload script for the two div's. The data DOES change in the script, but the two div's won't display the new data until it is refreshed again. Do I need to reactivate fetch to get the new data?

I can’t edit the post so I’ll do this…

When I say it does update the script… I mean that it updates the database with the changes, but still show the older data.

Sponsor our Newsletter | Privacy Policy | Terms of Service