bonjour a tous,
Voila je souhaite integrer sur un site une fonction de recherche donc j'ai creer ma requete
mais apres pour l'affichage je bute :
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
28
29
30
31
32 //on recupere la valeur du champ de recherche $recherche=$_POST['recherche']; $recherche=htmlentities($recherche,ENT_QUOTES); $sql=("select * from integration where ref_int like'%$recherche%' OR titre_int like'%$recherche%' OR cat_int like'%$recherche%' OR fam_int like'%$recherche%' OR marque_int like'%$recherche%' UNION select * from peripheriques where ref_per like'%$recherche%' OR titre_per like'%$recherche%' OR cat_per like'%$recherche%' OR fam_per like'%$recherche%' OR marque_per like'%$recherche%' UNION select * from connectiques where ref_con like'%$recherche%' OR titre_con like'%$recherche%' OR cat_con like'%$recherche%' OR fam_con like'%$recherche%' OR marque_con like'%$recherche%' UNION select * from multimedia where ref_mul like'%$recherche%' OR titre_mul like'%$recherche%' OR cat_mul like'%$recherche%' OR fam_mul like'%$recherche%' OR marque_mul like'%$recherche%' UNION select * from consommables where ref_con like'%$recherche%' OR titre_con like'%$recherche%' OR cat_con like'%$recherche%' OR fam_con like'%$recherche%' OR marque_con like'%$recherche%' UNION select * from reseaux where ref_res like'%$recherche%' OR titre_res like'%$recherche%' OR cat_res like'%$recherche%' OR fam_res like'%$recherche%' OR marque_res like'%$recherche%' UNION select * from notebook where ref_not like'%$recherche%' OR titre_not like'%$recherche%' OR cat_not like'%$recherche%' OR fam_not like'%$recherche%' OR marque_not like'%$recherche%'"); $result=mysql_query($sql);
Ex: Si je veux afficher les refences de integration je fais echo "".$row[ref_int].""; mais hélas dans la recherche ce n'ai pas le resultat voulu etant donné qu'il faut afficher tous les resultat de toutes les tables
C'est un peu brouillon mon explication mais bon j'ai fais au mieu![]()
Partager