PHP function getX($id){
$ath = mysql_query("select * from contas where id like '".$id."'");
$statsfile = mysql_fetch_array($ath);
return $statsfile['x'];
}
function getY($id)
{
$ath = mysql_query("select * from contas where id like '".$id."'");
$statsfile = mysql_fetch_array($ath);
return $statsfile['y'];
}
JavaScript
function mov()
{
movegta(player0,<?php echo getX(0);?>,<?php echo getY(0);?>);
movegta(player1,<?php echo getX(1);?>,<?php echo getY(1);?>);
//move(player0,GetImageLocationx(player0)+5,GetImageLocationy(player0));
return setTimeout("mov()",750);
} Não pegou como eu queria ficou assim: por exemplo se no banco de dados estiver X=1 e Y=5 ai eu carrego a pagina as e mudo os X para 0 e Y para 11 no MYSQL as funções não retornam o novo valor, X retorna 1 e Y retorna 5 e não 0 e 11.