从产品表中按照各种零售商的类似产品价格比较结果

时间:2015-10-08 14:42:19

标签: php mysql

我正在使用这些查询。表名是wp_pc_products_merchants和wp_pc_products。用户名称正在搜索框中插入。我们已经在数组中拆分了,我们根据查询中的位置接受了变量。

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());

我正在使用php和mysql。

它给了我同一零售商的多个结果,我可以说它给了我类似的结果。

我需要帮助才能显示出具有尊重结果的类似产品。

由于

1 个答案:

答案 0 :(得分:0)

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());