Bonjour,
J'ai une base de données MYSQL
Je voudrais créer 2 listes déroulantes complémentaires l'une de l'autre ...
Dans le script ci-dessous, j'arrive presque à faire mes 2 listes mais à les lier : PAS DU TOUT ....
Quelqu'un peut-il m'aider ... ???


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
 
<table width="750" border="0" height="350" align="center">
<tr>
<td class="principal" width="273" height="99"> Choisissez une FAMILLE :
</td>
<td class="principal" width="467" height="99">
 
<form method="post" name="formu" action="<?echo $PHP_SELF;?>">
 
<?php
mysql_connect("localhost","root","mysql");
mysql_selectdb("INVENTAIRE_LABOSEP") or die("Connexion impossible");
$requete=mysql_query("select distinct IMMATRICULATION_Materiel from MATERIEL");
?>
 
<? 
echo('<select name="specia" >');
echo('<option value="'.'">'.'</option>');
while ($ligne=mysql_fetch_object($requete))
{
echo('<option value="'.$ligne->IMMATRICULATION_Materiel .'">'.$ligne->IMMATRICULATION_Materiel.'</option>'); 
}
echo('</select>');
mysql_close;
?>
 
<input type="submit" name="bnsubmit" value="Valider">
</form>
</td>
</tr>
 
<tr>
<td class="principal" width="273" height="106"> Choisissez une SOUS-FAMILLE :
</td>
<td class="principal" width="467" height="106">
 
<form method="post" name="med" action="">
 
<? 
$requete1=mysql_query("select * from LOUE where IMMATRICULATION_Materiel='$specia'");
?>
 
<? 
echo('<select name="med">');
if($specia=="")
{
echo('<option value="'.'">'.'Choisir'.'</option>');
}
else
{
echo('<option value="'.'">'.'</option>');
}
while ($ligne1=mysql_fetch_object($requete1))
{
echo('<option value="'.$ligne1->NUMERO_Fabriquant .'">'.$ligne1->NUMERO_Fabriquant.'</option>'); 
}
echo('</select>');
mysql_close;
 
?>
 
<input type="submit" name="bncherche" value="Chercher">
</form>
 
</td>
</tr>
</table>