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
|
<?php
$sql = "SELECT id_Cat, nom_Cat FROM Categorie";
$res= mysql_query($sql);
echo "<form method=\"post\" action=\"".$_SERVER['PHP_SELF']."\" >";
echo "<select name=\"maCat\" >";
while($data= mysql_fetch_assoc($res)){
echo "<option name=\"".$data['id_Cat']."\" >".$data['nom_Cat']."</option>";
}
echo "</select>";
echo "<input type=\"submit\" name=\"envoi\" value=\"Envoyer\" />";
echo "<form >";
if(isset($_POST['envoi'])){
$sqll="SELECT * FROM Produit WHERE id_Cat = '".$_POST['maCat']."'";
$ress=mysql_query($sqll);
while($dataa=mysql_fetch_assoc($ress)){
echo $dataa['nom_Produit'];
}
}
?> |
Partager