salut svp qui peux m'aider j'ai entrain de faire une application et j'ai fais un code qui permet de faire une recherche dans un e bibliothèque... le code ça marche bien mais quand je choisi un critère de recherche dans une parmi les 3 listes déroulante que j'ai construit il m'affiche les ouvrages ça marche bien aussi mais le contenu de la liste déroulante n'affiche pas le critère de recherche que j'ai choisi je veux qu'il reste pour savoir par quelle critère j'ai fais ma recherche ... voilà mon code php5:et merci cordialement si vous pouvez m'aider sur ce truc le plutôt possible svp!
<?php
include("config.inc.php");
echo "<b><i><font size='+1'>Recherche simple:</font></i></b>";
echo"<form name=\"recherche_ouvrage\" action=\"./?page=$page§ion=$section\" method=\"POST\" " ;
echo"<tr>";
echo"<td>";
print_input("foreignkey","<b><i>Type de livre</i></b>","book_type","","","b_type","id","type");
print_input("foreignkey","<b><i>Famille de livre</i></b>","b_famille","","","b_family","family_id","name");
print_input("foreignkey","<b><i>Catégorie de livre</i></b>","b_categorie","","","b_categorie","id","name");
echo "<input type='submit' name='submit_research' value='recherche'/>";
echo"</tr>";
echo"</td>";
echo"</form>";
if(isset($_POST["submit_research"]))
{
//Récupération de données
$b_type=$_POST["book_type"];
$b_famille=$_POST["b_famille"];
$b_categorie=$_POST["b_categorie"];
$sql="select B.code,B.title,BA.first_name,BA.last_name from b_books B,b_authors BA,b_book_author BBA";
if($b_type=="" && $b_famille=="" && $b_categorie=="")
$sql.=" where BBA.book_id=B.id and BA.id=BBA.author_id;";
//Receherche par type d'ouvrage
if($b_type!="" && $b_famille=="" && $b_categorie=="")
$sql.=" ,b_type T where T.id=B.type_id and BBA.book_id=B.id and BA.id=BBA.author_id and T.id='$b_type'";
else
//Recherche par famille
if($b_type=="" && $b_famille!="" && $b_categorie=="")
$sql.=" ,b_family F,b_categorie C where BBA.book_id=B.id and BA.id=BBA.author_id and F.family_id=C.family_id and C.id=B.category_id and F.family_id='$b_famille';";
else
//recherche par catégorie
if($b_type=="" && $b_famille=="" && $b_categorie!="")
$sql.=" ,b_categorie C where BBA.book_id=B.id and BA.id=BBA.author_id and C.id=B.category_id and C.id='$b_categorie';";
else
//Recherche par type d'ouvrage et famille
if($b_type!="" && $b_famille!="" && $b_categorie=="")
$sql.=" ,b_type T,b_family F,b_categorie C where T.id=B.type_id and BBA.book_id=B.id and BA.id=BBA.author_id and F.family_id=C.family_id and C.id=B.category_id and T.id='$b_type' and F.family_id='$b_famille'";
else
//Recherche par type d'ouvrage et catégorie
if($b_type!="" && $b_famille=="" && $b_categorie!="")
$sql.=" , b_type T,b_categorie C where T.id=B.type_id and BBA.book_id=B.id and BA.id=BBA.author_id and C.id=B.category_id and T.id='$b_type' and C.id='$b_categorie';";
else
//recherche par type d'ouvrage, famille et catégorie
if($b_type!="" && $b_famille!="" && $b_categorie!="")
$sql.=" ,b_type T,b_family F,b_categorie C where T.id=B.type_id and BBA.book_id=B.id and BA.id=BBA.author_id and F.family_id=C.family_id and C.id=B.category_id and T.id='$b_type' and F.family_id='$b_famille' and C.id='$b_categorie'";
else
//recherche par famille et catégorie
if($b_type=="" && $b_famille!="" && $b_categorie!="")
$sql.=" ,b_family F,b_categorie C where BBA.book_id=B.id and BA.id=BBA.author_id and F.family_id=C.family_id and C.id=B.category_id and F.family_id='$b_famille' and C.id='$b_categorie';";
$result = mysql_query($sql,$connection) or die (mysql_error());
echo"<p align='center'><b><i><font size='+1'> LISTE DES OUVRAGES</font></i></b></p>";
echo"<table align='center'>";
echo"<tr>";
echo"<td align='center'><font color='#541963' size='+1'>Code</font></td>";
echo"<td align='center'><font color='#541963' size='+1'>Titre</font></td>";
echo"<td align='center'><font color='#541963' size='+1'>Nom d'auteur</font></td>";
echo"<td align='center'><font color='#541963' size='+1'>Prénom d'auteur</font></td>";
echo"</tr>";
while ($db_field = mysql_fetch_object($result)) {
echo"<tr>";
echo "'<td>$db_field->code</td>'";
echo "'<td>$db_field->title</td>'";
echo "'<td>$db_field->first_name</td>'";
echo "'<td>$db_field->last_name</td>'";
echo"</tr>";
}
echo"</table>";
if(isset($_POST['book_type']))
{
$book_type=$_POST['book_type'];
}
if(isset($_POST['b_famille']))
{
$b_famille=$_POST['b_famille'];
}
if(isset($_POST['b_categorie']))
{
$b_categorie=$_POST['b_categorie'];
}
}
?>