Ecco:
Codice PHP:
<?php
include("config.php");
ob_start();
$page = htmlspecialchars($_GET['page']);
if (! $page OR $page != "report") {
header("Location: classifiche.php");
// LEGA A
$query = mysql_query("SELECT * FROM classifiche WHERE lega = 'a' ORDER BY punti ASC") or die (mysql_error());
$row = mysql_num_rows($query);
if ($row == 0) {
echo "[b]Errore: nessun team selezionato per questa lega[/b]";
} else {
echo '<table border = "1"><tr rowspan="2"><td colspan="7">[b]SERIE A[/b]</td></tr>';
echo '[b]<tr><td width="15%">Pos.</td><td width="35%">Nome team</td><td width="10%">Pnt</td><td width="10%">Giocate</td><td width="10%">V</td><td width="10%">P</td><td width="10%">N</td></tr>[/b]';
Qui sotto dovrebbe esserci il ciclo while, ma non so come strutturarlo. E' vero che vengono tutte ordinate in base ai punti le squadre, ma nella colonna Pos. come posso far apparire il numeretto 1-2-3 etc senza che sia registrato nel database?