Bonjour,
J'ai mon script qui dois m'afficher un récapitulatif des clients par ligne mais voila je n'ai qu'une ligne d'affiché au lieu de la totalité.
J'ai une boucle while qui ne dois pas bien fonctionner, j'au rai besoin un peux d'aide de votre part
Je vous remercie par avance de votre aide
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57 <?php include('../inc/inc_connexion.php'); $result = mysql_query("SELECT soc_id, soc_adherent, COUNT(fact_facture) AS nb_fact, soc_region, fact_montant, soc_societe FROM facture, societe WHERE fact_id = soc_id ORDER BY soc_id")or die(mysql_error()); $ligne = "<table BORDER=1 BORDERCOLOR=#CCCCCC BGCOLOR=#fffccc CELLSPACING=0 CELLPADDING=2 WIDTH=98% ALIGN=left font-family:Verdana size=10px><tr> <td bgcolor='#669999'><b><u>Numero</u></b></td> <td bgcolor='#669999'><b><u>Societe</u></b></td> <td bgcolor='#669999'><b><u>Adhérent</u></b></td> <td bgcolor='#669999'><b><u>Région</u></b></td> <td bgcolor='#669999'><b><u>NB</u></b></td> <td bgcolor='#669999'><b><u>Montant</u></b></td>"; $total = 0; while($recap = mysql_fetch_array($result)) { $id = $recap['soc_id']; $societe = $recap['soc_societe']; $adherent = $recap['soc_adherent']; $societe = $recap['soc_societe']; $region = $recap['soc_region']; $nb_fact = $recap['nb_fact']; //$enseigne = $recap['enseigne']; //$telephone = $recap['telephone']; //$fax = $recap['fax']; //$siret = $recap['siret']; $mont += addslashes($recap['fact_montant']); $total += $mont; if($mont > 0) { $ligne .= "<tr> <td valign=top><h5><a href='fiche_pdv.php?numero=$id' target='_self'>".$id."</a></h5></td> <td valign=top ><h5>".$societe."</h5></td> <td valign=top><h5>".$adherent."</h5></td> <td valign=top><h5>".$region."</h5></td> <td valign=top><h5>".$nb_fact."</h5></td> <td valign=top align='right'><h5>".$mont."</h5></td></tr>"; } } $ligne .= "<tr><td colspan='5' valign ='center'><h5>Total Final</h5></td><td align='right' valign ='center'><h5>".$total."</h5></td></tr>"; $ligne .= "</table>"; echo $ligne; ?>
Runcafre91
Partager