Bonjour,

Voilà j'ai une requette qui m'affiche toute les commandes passer sur le site mais le soucis quand le client commande plusieur article ca m'affiche plusieur fois les mêmes numero de commande, ci joint un exemple.

J'aimerais savoir comment faire pour que les cmd s'affiche une seul fois pour eviter les doublons.

Num CMD Nom Client Date Type CMD Total Actions

381 16-03-2009 Facture 105.85 € Print PDF
381 16-03-2009 Facture 105.85 € Print PDF
383 16-03-2009 Facture 159.8 € Print PDF
383 16-03-2009 Facture 159.8 € Print PDF
383 16-03-2009 Facture 159.8 € Print PDF
383 16-03-2009 Facture 159.8 € Print PDF
384 16-03-2009 Facture 107.9 € Print PDF
385 16-03-2009 Facture 159.8 € Print PDF
386 16-03-2009 Facture 336.35 € Print PDF
386 16-03-2009 Facture 336.35 € Print PDF
386 16-03-2009 Facture 336.35 € Print PDF

Voilà actuellement ma requete d'affichage des cmd.

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
34
35
 
<?php
 
		  require("conf.php");
 
 
		  $connection = mysql_connect("$sql_serveur","$sql_login","$sql_pass");  
// test la connection  
if ( ! $connection )  die ("connection impossible");  
  // Connecte la base  
  mysql_select_db($sql_bdd) or die ("pas de connection");
 
		  // RECHERCHE SI ON A LA FAMILLE DANS STAT SINON ON AFFICHE 0	
          $found=mysql_query("SELECT login_soc FROM commande")
          or die(mysql_error());
          $nb1=mysql_numrows($found);
          if($nb1<>"0"){$erreur='Y';}else{$erreur='N';}
 
         if($erreur=='Y')
         {
 
          $select = "SELECT * FROM commande WHERE login_soc='$pseudo' order by cmd";
          $result = mysql_query($select,$connection) or die ('Erreur : '.mysql_error() );
	      while($row = mysql_fetch_array($result))
		  {
		  $rownom = $row['cmd'];
		  $rownom1 = $row['nom_client'];
		  $rownom2 = $row['date'];
		  $rownom3 = $row['type_cmd'];
		  $rownom4 = $row['total'];
 
 
 
 
?>