1 pièce(s) jointe(s)
Selection dans un Formulaire php et Mysql
Bonjour tout le monde.
j'ai crée une table Sql telle que (image jointe) :
J'ai crée un formulaire ou l'utilisateur choisit sa filière et après le groupe .Le problème est que dans ma liste à dérouler il me retourne tout les groupes crées alors que le but est de retourner les groupes spécifiques à la filière déjà choisie dans le formulaire .
voici mon code :
Code:
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
| <form id="form1" name="form1" method="post" action="modules2.php">
<table width="389" height="158" border="0">
<tr>
</strong> <span class="style1"><strong>Ecole: </strong></span><strong>
<label>
<?php
include("../config.php");
$sql=("SELECT DISTINCT filiere FROM filiere") or die ("erreur sql ".mysql_error());
$res = mysql_query($sql);
?>
<select name="filiere" id="filiere">
<?php while ( $resultat = mysql_fetch_array($res))
{?>
<option><?php echo $resultat['filiere']; ?></option>
<?php
}
?>
</select>
</label>
</strong>(<span class="style2">*</span>)</p>
<p align="left"><strong> </strong> <span class="style1"><strong>Groupe : </strong></span><strong> </strong><strong>
<label>
<?php
include("../config.php");
$sql=("SELECT DISTINCT groupe FROM filiere ") or die ("erreur sql ".mysql_error());
$res = mysql_query($sql);
?>
<select name="groupe" id="groupe">
<?php while ( $resultat = mysql_fetch_array($res))
{?>
<option><?php echo $resultat['groupe']; ?></option>
<?php
}
?>
</select>
</label>
</strong>(<span class="style2">*</span>)</p>
<p align="left"><strong>
</strong> <span class="style1"><strong>Niveau: </strong></span><strong> </strong><strong>
<label>
<?php
include("../config.php");
$sql=("SELECT DISTINCT niveau FROM filiere") or die ("erreur sql ".mysql_error());
$res = mysql_query($sql);
?>
<select name="niveau" id="niveau">
<?php while ( $resultat = mysql_fetch_array($res))
{?>
<option><?php echo $resultat['niveau']; ?></option>
<?php
}
?> |
Merci de votre aide.