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
| function recherche()
{
$famille=$_POST["famille"];
$marque=$_POST["marque"];
$dim=$_POST["dim"];
if(!empty($marque))
{//echo $marque;
$query="select * from produits where dimension like '%$dim%' and categorie='$famille' and marque='$marque'";
$result=mysql_query($query);
$nb=mysql_num_rows($result);
if($nb<>0)
{
$i=0;
while($ligne=mysql_fetch_array($result))
{echo"<div>Le produit est".$ligne["1"]."</div>";
$i++;}
}else echo"votre recherche n'existe pas";
}
if(empty($marque))
{$query1="select * from produits where dimension like '%$dim%' and categorie='$famille'";
$result1=mysql_query($query1);
$nb1=mysql_num_rows($result1);
if($nb1<>0){
$i=0;
while($ligne1=mysql_fetch_array($result1))
{echo"<div>Le produit est".$ligne1["dimension"]."</div>";
$i++;}
}else echo"votre recherche n'existe pas";
}
} |