Faire un classement dans un tableau
Posté : 08 juil. 2005, 13:27
Bonjour j'ai une liste de participants pour un rassemblement.
Des infos sont demandées aux participants (nom, prenom, team...)
Je voudrais savoir comment faire pour que ceux ci soient classés par team.
Voici mon code de l'insertion des données :
Des infos sont demandées aux participants (nom, prenom, team...)
Je voudrais savoir comment faire pour que ceux ci soient classés par team.
Voici mon code de l'insertion des données :
echo "<table>";
echo "<tr><td width=\"90\"><strong>Pseudo</strong></td><td width=\"90\"><strong>Prenom</strong></td><td width=\"90\"><strong>Equipe</strong></td><td width=\"90\"><strong>Tournoi CS</strong></td><td width=\"90\"><strong>Tournoi W3</strong></td><td width=\"90\"><strong>Tournoi UT</strong></td></tr>";
while( $contenu = mysql_fetch_array ($req)) {
echo "<tr>";
echo "<td>".$contenu[pseudo]."</td>";
echo "<td>".$contenu[prenom]."</td>";
echo "<td>".$contenu[equipe]."</td>";
if($contenu["counter"] == 'Y')
{
print "<td><img src='http://scipately.free.fr/images/icons/Y.gif'</td>";
}
else{
print "<td><img src='http://scipately.free.fr/images/icons/N.gif'</td>";
}
if($contenu["warcraft"] == 'Y')
{
print "<td><img src='http://scipately.free.fr/images/icons/Y.gif'</td>";
}
else{
print "<td><img src='http://scipately.free.fr/images/icons/N.gif'</td>";
}
if($contenu["unreal"] == 'Y')
{
print "<td><img src='http://scipately.free.fr/images/icons/Y.gif'</td>";
}
else{
print "<td><img src='http://scipately.free.fr/images/icons/N.gif'</td>";
}
echo "</tr>";
}
echo "</table>";
//je referme la connexion
mysql_close();
//----------------- FIN --------------------------------
?>