Codice PHP:
<?php
$query="SELECT * FROM sts2012";
$risultati=mysql_query($query);
$num=mysql_numrows($risultati);
mysql_close();
?>
<table border="2" cellspacing="3" cellpadding="4">
<tr>
<th><font face="Arial, Helvetica, sans-serif">Numero</font></th>
<th><font face="Arial, Helvetica, sans-serif">Nome</font></th>
<th><font face="Arial, Helvetica, sans-serif">Ruolo</font></th>
<th><font face="Arial, Helvetica, sans-serif">Presenze</font></th>
<th><font face="Arial, Helvetica, sans-serif">Goal</font></th>
<th><font face="Arial, Helvetica, sans-serif">Assist</font></th>
<th><font face="Arial, Helvetica, sans-serif">YellowCard</font></th>
<th><font face="Arial, Helvetica, sans-serif">RedCard</font></th>
</tr>
<?php
$i=0;
while ($i < $num) {
$Numero=mysql_result($risultati,$i,"Numero");
$Nome=mysql_result($risultati,$i,"Nome");
$Ruolo=mysql_result($risultati,$i,"Ruolo");
$Presenze=mysql_result($risultati,$i,"Presenze");
$Goal=mysql_result($risultati,$i,"Goal");
$Assist=mysql_result($risultati,$i,"Assist");
$YellowCard=mysql_result($risultati,$i,"YellowCard");
$RedCard=mysql_result($risultati,$i,"RedCard");
?>
<tr>
<td><font face="Arial, Helvetica, sans-serif"><?php echo $Numero;?></font></td>
<td><font face="Arial, Helvetica, sans-serif"><?php echo $Nome;?></font></td>
<td><font face="Arial, Helvetica, sans-serif"><?php echo $Ruolo;?></font></td>
<td><font face="Arial, Helvetica, sans-serif"><?php echo $Presenze;?></font></td>
<td><font face="Arial, Helvetica, sans-serif"><?php echo $Goal;?></font></td>
<td><font face="Arial, Helvetica, sans-serif"><?php echo $Assist;?></font></td>
<td><font face="Arial, Helvetica, sans-serif"><?php echo $YellowCard;?></font></td>
<td><font face="Arial, Helvetica, sans-serif"><?php echo $RedCard;?></font></td>
</tr>
<?php
$i++;
}
?>
</table>