Bonjour,
J'ai créer une requête afin de faire une recherche dans ma base de donnée mais voila j'ai aucun résultat
ci-dessous la structure de ma table
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 -- -- Structure de la table `facture` -- CREATE TABLE IF NOT EXISTS `facture` ( `fact_id` varchar(7) NOT NULL, `fact_facture` varchar(14) NOT NULL, `fact_intitule` varchar(60) NOT NULL, `fact_montant` double NOT NULL, `fact_session` tinytext NOT NULL, `fact_date` varchar(20) NOT NULL, `fact_echeance` varchar(20) NOT NULL, `fact_type` varchar(15) NOT NULL, `fact_annee` varchar(5) NOT NULL, PRIMARY KEY (`fact_facture`), UNIQUE KEY `facture` (`fact_facture`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
voici mon script
Je vous remerci de l'aide que vous pourriez m'apporter
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75 <?php include('../inc/inc_connexion.php'); if(!empty($_POST['numero'])) { $numero=$_POST['numero']; echo $numero; $lignes = "<table BORDER=1 BORDERCOLOR=#CCCCCC BGCOLOR=#fffccc CELLSPACING=0 CELLPADDING=1 WIDTH=98% ALIGN=left font-family:Verdana size=10px> <td bgcolor='#669999'><b><u>Numero</u></b></td> <td bgcolor='#669999'><b><u>Facture</u></b></td> <td bgcolor='#669999'><b><u>Libelle</u></b></td> <td bgcolor='#669999'><b><u>Montant</u></b></td> <td bgcolor='#669999'><b><u>Date facture</u></b></td> <td bgcolor='#669999'><b><u>Date echeance</u></b></td> <td bgcolor='#669999'><b><u>Relance</u></b></td> <td bgcolor='#669999'><b><u>L 01</u></b></td> <td bgcolor='#669999'><b><u>L 02</u></b></td> <td bgcolor='#669999'><b><u>L 03</u></b></td> <td bgcolor='#669999'><b><u>L 04</u></b></td></tr>"; //**************************************************************************** //***************************************************************************** $result = mysql_query("SELECT fact_facture, fact_id, fact_date, fact_echeance, fact_montant FROM facture WHERE fact_id LIKE '".$numero."'") or die(mysql_error()); $total = 0; $mont = 0; while($ligne = mysql_fetch_assoc($resultat)) { //$id = $ligne['soc_id']; $facture = $ligne['fact_facture']; $societe = $ligne['soc_societe']; $adherent = $ligne['soc_adherent']; $societe = $ligne['soc_societe']; $region = $ligne['soc_region']; $nb_fact = $ligne['nb_fact']; $intitule = $ligne['fact_intitule']; $date_fact = $ligne['fact_date']; $date_echeance = $ligne['fact_echeance']; $enseigne = $ligne['soc_enseigne']; $telephone = $ligne['soc_telephone']; $fax = $ligne['soc_fax']; $siret = $ligne['soc_siret']; // Les calculs du total $mont = addslashes($ligne['fact_montant']); $total += $mont; $lignes .= "<tr> <td><a href='./vues/fiche_pdv.php?numero=$id'>".$id."</a></td> <td>".$facture."</td> <td>".$intitule."</td> <td align='right'>".$montant."</td> <td align='center'>".$date_fact."</td> <td align='center'>".$date_echeance."</td>"; } $lignes .= "<td align='center'>".$ligne['fact_facture']."</td>"; $lignes .= "</tr>"; } $lignes .= "<tr><td colspan='3'>Montant total </td><td align='right'>".$total."</td></tr>"; echo $lignes; mysql_free_result($resultat); ?>
Runcafre91
Partager