Bonjour à tous,
Voila je vous expose mon problème, en espérant être le plus clair possible.
J'ai créé un classement qui utilise la table résultat :
en utillisant ce code :
ce qui me donne ceci :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32 <?php $reponse = "SELECT pilote, sum(point) AS total, nationalite, ecurie, moteur from resultat where annee='$an' group by pilote order by total DESC"; $req = mysql_query($reponse) or die(mysql_error()); echo "<h2><a href=\"#\">Classement Pilotes : $an</a></h2>"; ?> <div class="articles"><table width=100%> <tr align=center> <td align=center width=5%><h4><strong>Rg</strong></h4></td> <td align=center width=40%><h4><strong>Pilote</strong></h4></td> <td align=center width=10%><h4><strong>Nationalité</strong></h4></td> <td align=center width=30%><h4><strong>Ecurie - Moteur</strong></h4></td> <td align=center width=30%><h4><strong>Points</strong></h4></td> </tr> <?php $i=1; while ($donnees=mysql_fetch_array($req) ) { echo "<tr align=center> <td align=center width=5%>$i</td> <td align=center width=40%><a href=\"pilote_carriere.php?nom=$donnees[pilote]\">$donnees[pilote]</a></td> <td align=center width=10%><img valign=middle src='images/$donnees[nationalite].png' border='1' align='absmiddle' width=35 height=35 /></td> <td align=center width=30%><a href=\"ecurie_detail.php?ecurie=$donnees[ecurie]\">$donnees[ecurie]</a> - $donnees[moteur]</td> <td align=center width=30%>$donnees[total]</td>"; $i++; } ?> </tr></table> </div>
Maintenant, j'ai créé une page qui regroupe tout les résultats d'un même pilote en les classant par année avec ce code :
Voila le résultat :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33 <?php $nom1=$_GET['nom']; $nom = str_replace('_', ' ', $nom1); $reponse = "SELECT count(gp) AS nbre, sum(point) AS total, pilote, annee, ecurie, moteur from resultat where pilote='$nom' group by annee order by annee DESC"; $req = mysql_query($reponse) or die(mysql_error()); ?> <div class="articles"><table width=100%> <tr align=center> <td align=center width=12%><h4>Année</h4></td> <td align=center width=12%><h4>GP</h4></td> <td align=center width=16%><h4>Point</h4></td> <td align=center width=20%><h4>Ecurie</h4></td> <td align=center width=20%><h4>Moteur</h4></td> <td align=center width=16%><h4>Classement</h4></td> </tr> <?php while ($donnees=mysql_fetch_array($req) ) { $var = str_replace(' ', '_', $donnees['pilote']); echo "<tr align=center> <td align=center width=16%><a href=\"pilote_saison.php?nom=$var&annee=$donnees[annee]\">$donnees[annee]</a></td> <td align=center width=16%>$donnees[nbre]</td> <td align=center width=16%>$donnees[total]</td> <td align=center width=16%><a href=\"ecurie_detail.php?ecurie=$donnees[ecurie]\">$donnees[ecurie]</a></td> <td align=center width=16%>$donnees[moteur]</td> <td align=center width=16%></td>"; } ?>
J'en arrive donc à ma question :
Comment faire pour remplir les cases classement qui reste vide sur la dernière image en récupérant le rang des pilotes provenant du classement pilote ?
Si quelqu'un peut m'éclairer avant que mes voisins portent plainte pour tapage nocturne et diurne à force de me claquer la tête contre les mursdepuis deux jours.
Cela serait fort appréciable pour eux et pour ma tête.
Partager