Bonjour, sur ce lien http://ctertrais.free.fr les carrés s'affiche normalement mais en plusieurs fois ce que je cherche c'est a comprendre pourquoi ils s'affcihent plusieurs fois.Je viens de remarquer qu'il s'affiche autant de fois qu'il y a de numéros de casse dans ma requête mysql. Comment faire pour que chaque numéros s'affiche une seule fois?En tout il doit y avoir 100 carrés avec des numéro allant de 1 à 100.

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
<center><h1>Winer coins</h1></center>
<?php include "config.php" ;?>
<style>
div{
  display:inline-block;
  vertical-align:top;
}
</style>
<div style="height:1000px;width:1200px;"> <?php
 
 
$i=0;
$a=1;
while($i<100) {
$ra= mysql_query("SELECT numero FROM carre WHERE color=1");
while($r = mysql_fetch_array( $ra )){
if($a != $r['numero']){
 ?><a href="http://ctertrais.free.fr/buy.php?id=<?php echo $a;?>"><div id="<?php echo $a;?>"style="margin-bottom:10px;width: 72px; height:72px; background: url('img/carrevide.png');"><?php echo $a;?></div></a> <?php
  }
  else{
  ?><a href="http://ctertrais.free.fr/buy.php?id=<?php echo $a;?>"><div id="<?php echo $a;?>"style="margin-bottom:10px;width: 72px; height:72px; background: url('img/carreplein.png');"><?php echo $a;?></div></a><?PHP
}}
  $i=$i+1;
  $a=$a+1;
}
?></div>