Bonsoir
C'est encore moi
J'ai un bug avec le script suivant :
Code php : 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 $db = mysql_connect('localhost','root',''); mysql_select_db('projet',$db); $sql = "'SELECT num_cli,cat,vol,comp,num_pan_a, PANIER_AVIONref_a, TARIF_AVION.ref_a,quantite,montant,date_c,date_f,date_d FROM TARIF_AVION,PANIER_AVION WHERE num_cli='".mysql_real_escape_string($num_cli)."'AND PANIER_AVION.ref_a=TARIF_AVION.ref_a'"; $req = mysql_query($sql) or die('Erreur SQL ! '.$sql.' '.mysql_error()); echo "<div align=\"center\"><center> <table border=\"1\">"; $i=0; while($data = mysql_fetch_array($req) AND $data['num_cli']=$num_cli) { echo "<tr>"; echo "<td>"; echo " Commande numéros :" ; echo "</td> "; echo "<td>"; echo $data['num_pan_a']; echo "</td> "; echo "</tr>"; } echo " </table> </center></div>"; mysql_close();
Voici le message d'erreur :
Ici je dispose d'un numéro de client extérieur à la base .Erreur SQL ! 'SELECT num_cli,cat ,vol ,comp , num_pan_a, PANIER_AVIONref_a, TARIF_AVION.ref_a, quantite, montant, date_c, date_f, date_d FROM TARIF_AVION , PANIER_AVION WHERE num_cli LIKE'2'AND PANIER_AVION.ref_a=TARIF_AVION.ref_a' You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''SELECT num_cli,cat ,vol ,comp , num_pan_a, PANIER_AVIONref_a, TARIF_AVION.ref_a' at line 1
J'en m'en sert pour :
- retrouver toutes les commandes que le client a passé
- je doit toute les afficher dans un tableau ( seulement le numéros de la commande pour le moment pour simplifier )
Je pense à un problème d'affichage au niveau du while ?
Merci d'avance
Partager