Já que ninguém quis lhe enviar o código eu fiz aqui rapidinho.
Crie um arquivo chamado exibe.php com o código abaixo, ele será responsável por exibir a quantidade de jogadores online:
Código:
<?
$conexao = mssql_connect(".", "sa", "vps01");
mssql_select_db("MuOnline", $conexao);
$online = mssql_fetch_array(mssql_query("select count(*) from memb_stat where connectstat=1", $conexao));
echo $online[0];
?>
Agora no arquivo onde será exibido você pode fazer assim:
Código:
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Documento sem título</title>
<script>
var intervalID = window.setInterval(Atualiza, 60000*5);
function Atualiza()
{
PSLoad('result', 'exibe.php');
}
function PSLoad(id,url)
{
objetoHTML=document.getElementById(id);
try{
xmlhttp = new XMLHttpRequest();
}catch(ee){
try{
xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
}catch(e){
try{
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
}catch(E){
xmlhttp = false;
}
}
}
xmlhttp.open("GET",url);
xmlhttp.onreadystatechange=function()
{
if (xmlhttp.readyState==4)
{
retorno=unescape(xmlhttp.responseText.replace(/\+/g," "));
objetoHTML.innerHTML=retorno;
}
}
xmlhttp.send(null);
};
</script>
</head>
<body>
<div id="result">
<?
$conexao = mssql_connect(".", "sa", "vps01");
mssql_select_db("MuOnline", $conexao);
$online = mssql_fetch_array(mssql_query("select count(*) from memb_stat where connectstat=1", $conexao));
echo $online[0];
?>
</div>
</body>
</html>