Olá Pessoal.
Vou apresentar-lhe scripts PHP simples para:
Últimas Contas / Personagens & Max Players Online.
Tudo o que você tem a fazer é mudar o texto em vermelho.
Desfrutar.
Latest Accounts:
Latest Characters
Max Online Players
Vou apresentar-lhe scripts PHP simples para:
Últimas Contas / Personagens & Max Players Online.
Tudo o que você tem a fazer é mudar o texto em vermelho.
Desfrutar.
Latest Accounts:
Código:
<h2>Latest Accounts</h2>
<?php
$conn=mysql_connect('[color=Red]localhost[/color]', '[color=Red]root[/color]', '[color=Red]ascent[/color]') or die();
mysql_select_db('[color=Red]realms[/color]');
$query_acc=mysql_query("SELECT username, id FROM account ORDER BY id DESC LIMIT 3") or die (mysql_error());
$num_acc=mysql_num_rows($query_acc);
mysql_close($conn);
while($fetch_acc=mysql_fetch_array($query_acc)) {?>
<li>
<strong><?php print $fetch_acc['username']; ?></strong>
</li>
<?php }?>
Latest Characters
Código:
<h2>Latest Characters</h2>
<?php
$conn=mysql_connect('[color=Red]localhost[/color]', '[color=Red]root[/color]', '[color=Red]ascent[/color]') or die();
mysql_select_db('[color=Red]chars[/color]');
$query_cha=mysql_query("SELECT name, guid FROM characters ORDER BY guid DESC LIMIT 3") or die (mysql_error());
$num_cha=mysql_num_rows($query_cha);
mysql_close($conn);
while($fetch_cha=mysql_fetch_array($query_cha)) {?>
<li>
<strong><?php print $fetch_cha['name']; ?></strong>
</li>
<?php }?>
Max Online Players
Código:
<h2>Max Online Players</h2>
<?php
$conn=mysql_connect('[color=Red]localhost[/color]', '[color=Red]root[/color]', '[color=Red]ascent[/color]') or die();
mysql_select_db('[color=Red]realms[/color]');
$query_max=mysql_query("SELECT maxplayers FROM uptime ORDER BY maxplayers DESC LIMIT 1") or die (mysql_error());
$num_max=mysql_num_rows($query_max);
mysql_close($conn);
$fetch_max=mysql_fetch_array($query_max);
?>
<strong><?php print $fetch_max['maxplayers']; ?></strong>