Bonjour,
J'ai 2 listes déroulantes. Dans la 1ère l'utilisateur choisit un type de diplome (Bac ou BTS ou Licence ...) Et à partir de son choix on affiche dans la 2ème liste déroulante les disciplines correspondantes.
Pas de souci pour la 1ère, mais pour la 2ème liste vide . Normal : Je n'ai pas de valeur dans select_diplome_1 . Comment faire ?
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 $result1=mysql_query("select distinct type from diplome order by type") or die ("Erreur table diplome"); ?> <select name="select_diplome_1"> <?php while (( $row1=mysql_fetch_object($result1) )) {?> <option value="<?php echo $row1->code_diplome;?>"> <?php echo $row1->type; ?> </option> <?php } ?> </select> <?php mysql_close();?> </td> <td width="45%"> <?php mysql_connect('localhost','user','mdp'); mysql_select_db(nom_base); $result11=mysql_query("select distinct libelle2 from diplome where type = '.$select_diplome_1.'") or die ("Erreur table diplome"); ?> <select name="select_dominante_1"> <?php while (( $row11=mysql_fetch_object($result11) )) {?> <option value="<?php echo $row11->code_diplome;?>"> <?php echo $row11->libelle2; ?> </option> <?php } ?> </select> <?php mysql_close();?>
Merci
Partager