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
| <?
//on recupere la valeur du champ de recherche
$recherche=$_POST['recherche'];
$recherche=htmlentities($recherche,ENT_QUOTES);
$sql=(" SELECT ref_int,titre_int,cat_int,fam_int,marque_int
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 ref_per,titre_per,cat_per,fam_per,marque_per
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 ref_con,titre_con,cat_con,fam_con,marque_con
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 ref_mul,titre_mul,cat_mul,fam_mul,marque_mul
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 ref_con,titre_con,cat_con,fam_con,marque_con
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 ref_res,titre_res,cat_res,fam_res,marque_res
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 ref_not,titre_not,cat_not,fam_not,marque_not
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);
?> |
Partager