Bonjour,

Je souhaiterais afficher des données dans mon tableau en fonction du nom choisit dans la liste déroulante, j'ai essayé tout simplement dans ma requete avec "where" mais ça ne marche pas.
Comment puis je faire?
Merci de votre aide, voici mon code :
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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
 
<?php 
$connexion = mysql_connect("localhost","root",""); 
if ($connexion) 
{ 
mysql_select_db("voyage",$connexion); 
 
 
?> 
Veuillez sélectionner le nom d'un salarié : <select> 
<Option value="-1">-- Nom --</Option> 
<?php 
 
//on se connecte à MySQL 
$db = mysql_connect('localhost', 'root', '') ; 
 
//on sélectionne la base 
mysql_select_db('Intranet',$db) ; 
 
$sql3 = "SELECT distinct Nom FROM personnel"; 
//on envoie la requête 
$req3 = mysql_query($sql3) or die(mysql_error()); 
 
//on fait une boucle qui va faire un tour pour chaque enregistrement 
while($data3 = mysql_fetch_assoc($req3)) 
 
//on affiche les informations de l'enregistrement en cours 
{ 
echo "<option value>" .$data3['Nom']. "</option>"; 
 
} 
//on ferme la connexion à mysql 
mysql_close(); 
} 
?>	
</select> 
<br><br><br> 
 
</form> 
 
<form> 
 
 
<table border bodercolordark="black" align = "center" cellpadding="10"><tr> 
<th>Date Demande</th> 
<th>Objet mission</th> 
<th>Nom</th> 
<th>Type transport</th> 
<th>Réduction en %</th> 
<th>Ville de départ</th> 
<th>Ville d'arrivée</th> 
<th>Date de départ</th> 
<th>Heure de départ</th> 
<th>Date de retour</th> 
<th>Heure de retour</th> 
<th>Demande d'hotel ?</th> 
<th>Nom de l'hotel n°1</th> 
<th>Nom de l'hotel n°2</th> 
<th>Nom de l'hotel n°3</th> 
<th>Type de chambre</th> 
<th>Fumeur ?</th> 
<th>Arrivée après 18H ?</th> 
<th>Nombre de nuits</th> 
</tr> 
<?php 
$connexion = mysql_connect("localhost","root",""); 
Mysql_select_db("Intranet",$connexion); 
 
//$sql_affichage = mysql_query('SELECT * FROM voyage where Nom = "'.$data3["Nom"].'"'); 
$sql_affichage = mysql_query('SELECT * FROM voyage'); 
while ($donnees = mysql_fetch_array($sql_affichage)) 
{ 
?> 
<tr> 
<td> 
<?php echo $donnees['Date_demande']; ?> 
</td><td> 
<?php echo $donnees['Objet_mission']; ?> 
</td><td> 
<?php echo $donnees['Nom']; ?> 
</td><td> 
<?php echo $donnees['Type_transport']; ?> 
</td><td> 
<?php echo $donnees['Reduction']; ?> 
</td><td> 
<?php echo $donnees['Ville_depart']; ?> 
</td><td> 
<?php echo $donnees['Ville_arrivee']; ?> 
</td><td> 
<?php echo $donnees['Date_depart']; ?> 
</td><td> 
<?php echo $donnees['Heure_depart']; ?> 
</td><td> 
<?php echo $donnees['Date_retour']; ?> 
</td><td> 
<?php echo $donnees['Heure_retour']; ?> 
</td><td> 
<?php echo $donnees['Hotel_oui_non']; ?> 
</td><td> 
<?php echo $donnees['Nom_hotel1']; ?> 
</td><td> 
<?php echo $donnees['Nom_hotel2']; ?> 
</td><td> 
<?php echo $donnees['Nom_hotel3']; ?> 
</td><td> 
<?php echo $donnees['type_chambre']; ?> 
</td><td> 
<?php echo $donnees['Fumeur_oui_non']; ?> 
</td><td> 
<?php echo $donnees['Arriver_ap_18h']; ?> 
</td><td> 
<?php echo $donnees['Nb_nuit']; ?> 
</td> 
</tr> 
 
<?php 
} 
?> 
 
</table> 
<tr> 
</form>