Afficher une fois la boite postale quand elle se idéntique
Bonjour à tous les gars!
Je développe un annuaire électronique jusque la tout va bien. J'ai un soucis, je vais essayer d'être le plus claire possible. Quand les infos dans ma BD sont les mêmes je regroupe car dans l'annuaire une entreprise peut avoir plusieurs numéros et la même boite postale du genre:
Nom de la société: CACOMIAF
Ville: Irlande
Adresse: 01 BP 1317
Tel: (225) 21 24 21 48
--------------------------
Nom de la société: CACOMIAF
Ville: Irlande
Adresse: 01 BP 1317
Tel: 21 24 21 49
--------------------------
Nom de la société: CACOMIAF
Ville: Irlande
Adresse: 01 BP 1317
Tel: 21 24 21 54
--------------------------
Mon problème j'aimerais que lorsque les boite postales sont les mêmes l'afficher une seule fois ce qui donnera:
Nom de la société: CACOMIAF
Ville: Irlande
Adresse: 01 BP 1317
Tel: 21 24 21 48
--------------------------
Nom de la société: CACOMIAF
Ville: Irlande
Tel: 21 24 21 49
--------------------------
Nom de la société: CACOMIAF
Ville: Irlande
Tel: 21 24 21 54
--------------------------
Voici ma requête:
Code:
1 2 3
| $query_client_affiche = "SELECT id,RAISON,LOCALITE,ADRESSE,QUALIFICATION,CONTACT,SECTEUR, COUNT(*) AS nb_num FROM page_jaune WHERE RAISON LIKE '%$_GET[RAISON]%' GROUP BY RAISON,CONTACT";
$client_affiche = mysql_query($query_client_affiche, $req) or die(mysql_error());
$row_client_affiche = mysql_fetch_assoc($client_affiche); |
Ma page d'affichage:
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
| <?php do { ?>
<table width="401" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="397" height="83" valign="top" bgcolor="#E2E2E2"><strong><br />
</strong>
<table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="6%"><img src="images/iconMail.png" width="16" height="16" /></td>
<td width="94%"><?php echo $row_client_affiche['LOCALITE']; ?></td>
</tr>
<tr>
<td><img src="images/iconAdresse.png" width="16" height="16" /></td>
<td><?php echo $row_client_affiche['ADRESSE']; ?></td>
</tr>
<tr>
<td><img src="images/iconTel.png" width="16" height="16" /></td>
<td>(225) <?php echo $row_client_affiche['CONTACT']; ?></td>
</tr>
</table>
<br /></td>
</tr>
</table>
<br />
<? }while($row_client_affiche = mysql_fetch_assoc($client_affiche)); ?> |