salut,
j'ai un problème au niveau d'un code php.j'ai un 1er fichier dans lequel j'ai 3listes deroulantes alimentes a partir de plusieurs tables.
dans le 2éme fichier je veux afficher les resultats apres un choix fait sur ces listes déroulantes
code 1 :
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
| <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" lang="fr">
<head>
<title>Page1</title>
<link rel="stylesheet" type="text/css" href="styles/page1.css" />
</head>
<body>
<form action ="traitement_liste.php" method ="POST">
<!-- 1ére select selon la branche-->
<select name="listeBranche">
<?php
include "connexion.php";
$req="select intit_br_fr from branche";
$res=mysql_query($req);
echo"<option>choisir</option>";
while($ligne=mysql_fetch_array($res))
{
echo"<option>$ligne[0]</option>";
}
?>
</select>
<!-- 2éme select seleon le niveau-->
<select name='listeNiveau'>
<?php
include "connexion.php";
$req="select niveau_insc from inscription";
$res=mysql_query($req);
echo"<option>choisir</option>";
while($ligne=mysql_fetch_array($res))
{
echo"<option>$ligne[0]</option>";
}
?>
</select>
<!-- 3éme select selon la classe-->
<select name="listeClasse">
<?php
include "connexion.php";
$req="select classe_insc from inscription";
$res=mysql_query($req);
echo"<option>choisir</option>";
while($ligne=mysql_fetch_array($res))
{
echo"<option>$ligne[0]</option>";
}
?>
</select>
<input name="rechercher" type="submit" value="Valider" />
<input name="annuler" type="reset" value="Annuler" />
</form>
</body>
</html> |
code2 :
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
| <?
//connexion a la bdd
include ("connexion.php");
//requete
$req="
SELECT eleve.CNE, inscription.niveau_insc, branche.intit_br_fr
FROM eleve, inscription, branche
WHERE
niveau_insc="$_POST['listeNiveau']" and
intit_br_fr="$_POST['listeBranche']" and
classe_insc="$_POST['listeClasse']"
AND eleve.CNE
IN (
SELECT CNE
FROM inscription
)
AND branche.ref_br
IN (
SELECT ref_br
FROM inscription
)";
$res=mysql_query($req) or die ('Erreur : '.mysql_error());
// Recuperation des resultats
while($row = mysql_fetch_row($res)){
echo '<td>';
echo $row[0];
echo '</td>';
}
?> |
j'aimerais bien savoir ou est le problème parce que lors de l'exécution rien ne s'affiche que ceci
'; echo $row[0]; echo '' } ?>
Partager