Kód: Vybrat vše
<?php
//Temp
error_reporting("E_ALL");
//MySQL config
define(mysqluser, "root");
define(mysqlhost, "localhost");
define(mysqlpass, "securebyqvkqhext");
define(mysqldata, "minecraft");
define(mysqltable, "iconomy");
//Connect us to the DB
$handler = mysql_connect(mysqlhost, mysqluser, mysqlpass) or die(mysql_error());
mysql_select_db(mysqldata, $handler) or die(mysql_error());
//Queries
$sql = mysql_query('SELECT id, username, balance FROM '.mysqltable.' ORDER BY id');
//Create table
print '<center>
<h1>iConomy Player Statistics</h1>
<table border="0" cellpadding="2" cellspacing="5">
<tr align="center">
<td width="30"><strong>ID</strong></td>
<td width="30"><strong>Username</strong></td>
<td width="30"><strong>Balance</strong></td>
</tr>';
//Fetch mysql data
while($data = mysql_fetch_assoc($sql)) {
print '<tr align="center">
<td><strong>' . $data["id"] . '</strong></td>
<td><strong>' . $data["username"] . '</strong></td>
<td><strong>' . $data["balance"] . '</strong></td>
</tr>';
}
print "</table></center>";