par
spilo » 02 oct. 2013, 17:21
Bonjour,
Pour générer un tableau simple avec des données php pas de problème ...
Mais dans le cadre d'un tableau mis en forme pour un tournoi, je cherche à afficher les résultats dans certaines cases uniquement.
...
<?php
// on recupere les infos concernant les joueurs inscrits au tournoi
$sql = 'SELECT * FROM open WHERE type = "OP_NAT" AND open.case = "Tab_A_64_1" ';
mysql_query("SET NAMES 'utf8'");
$req = mysql_query($sql) or die('Erreur SQL !<br />'.$req.'<br />'.mysql_error());
if(($data = mysql_fetch_array($req)) != NULL) {
extract($data);
}
?>
<p> </p>
<table width="800" class="tbl_tirage">
<tr align="center">
<td colspan="8"><strong><u>TABLEAU A</u></strong></td>
</tr>
<tr>
<td width="20"> </td>
<td width="150" class="joueur_1"><?php echo $nom_prenom WHERE open.case="TAB_A_64_1"; ?></td>
<td width="25"> </td>
<td width="150"> </td>
<td width="25"> </td>
<td> </td>
<td width="25"> </td>
<td> </td>
</tr>
<tr>
<td width="20"> </td>
<td width="150" class="joueur_2"><?php echo $nom_prenom WHERE open.case="TAB_A_64_2"; ?></td>
<td width="25" rowspan="2"><div class="css-arrow-right"> </div></td>
<td width="150" class="joueur_1">TAB_A_32_1</td>
<td width="25"> </td>
<td> </td>
<td width="25"> </td>
<td> </td>
</tr>
<tr>
<td width="20"> </td>
<td width="150" class="joueur_1">TAB_A_64_3</td>
<td width="150" class="joueur_2">TAB_A_32_2</td>
<td width="25" rowspan="4"><div class="css-arrow-right"> </div></td>
<td> </td>
<td width="25"> </td>
<td> </td>
</tr>
<tr>
<td width="20"> </td>
<td width="150" class="joueur_2">TAB_A_64_4</td>
<td width="25"> </td>
<td width="150"> </td>
<td width="150" class="joueur_1">TAB_A_16_1</td>
<td width="25"> </td>
<td> </td>
</tr>
... etc
et donc <?php echo $nom_prenom WHERE ...; ?> c'est pas possible
Je ne dispose que de 3 champs dans la table TYPE / CASE / NOM PRENOM
Comment je dois procéder pour afficher des valeurs spécifiques selon les cases du tableau ? j'imagine qu'il ne faut pas refaire une requête à chaque fois dans la case ...
Merci de m'éclairer.