I am using these query. Table name are wp_pc_products_merchants and wp_pc_products. The name user is inserting in search box. We have split that in array and we have taken in variables as per the position in query.
select image,feed_product_name,feed_product_desc,feed_product_image,price,deeplink,id_merchant from wp_pc_products_merchants m,wp_pc_products p
where m.slug = p.id_merchant and
feed_product_name LIKE '%$expname[0]%' and
feed_product_name LIKE '%$expname[1]%' and
feed_product_name LIKE '%$expname[2]%' and
feed_product_name LIKE '%$expname[3]%' and
feed_product_name LIKE '%$expname[4]%' Limit 5 ")
or die(mysql_error());
I am using php and mysql.
It's giving me multiple results from the same retailer and I can say it's giving me similar results.
I need help to display similar products with their respected result once.
Thanks
select image,feed_product_name,feed_product_desc,feed_product_image,price,deeplink,id_merchant from wp_pc_products_merchants m,wp_pc_products p
where m.slug = p.id_merchant and
feed_product_name LIKE '%$expname[0]%' or
feed_product_name LIKE '%$expname[1]%' or
feed_product_name LIKE '%$expname[2]%' or
feed_product_name LIKE '%$expname[3]%' or
feed_product_name LIKE '%$expname[4]%' Limit 5 ")
or die(mysql_error());