bonjour

j'avais une fonction de recherche qui marchait bien, mais j'ai fait des modifs et j'ai maintenant plusieurs tables et je souhaiterai rechercher maintenant sur ces 2 tables.
Mais tel que je l'ai fait forcément cela aurait été trop beau cela ne fonctionne pas, plus aucune recherche fonctionne.
dans la table produit il ya un champ importateur ou j'inser l'id du champ de la table fournisseur qui correspond
Code : Sélectionner tout - Visualiser dans une fenêtre à part
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
 
$mot=$_REQUEST['motclef'];
$mot=mysql_real_escape_string($mot);
//verification que la recherche ne soit pas vide
if (isset($mot)){
$motrecherche= 'WHERE `' . mysql_real_escape_string($searchpar) . '` LIKE "%' .$mot . '%"';
}
 
// verification si l'option rechercher partout est validé
if($searchpar=='partout'){
	$motrecherche='WHERE designation LIKE "%' . mysql_real_escape_string($mot) . '%" 
	or appellation LIKE "%' . mysql_real_escape_string($mot) . '%"
	or constructeur LIKE "%' . mysql_real_escape_string($mot) . '%"
	or importateur LIKE "%' . mysql_real_escape_string($mot) . '%"';
}
 
//requete avec tri et recherche
$sql= "SELECT  all * FROM produits,fournisseur ".$motrecherche.$ordre2;
 
 
 
$resultat=mysql_query($sql)or die(mysql_error());
 
while ($produits =mysql_fetch_array ($resultat)){
$id= $produits['id'];
$photo=$produits{'photo'};
$designation= $produits ['designation'];