因此,在更新Virtuemart之后,当我在客户站点上查找特定产品时,我会收到这个错误:
vmError:在where子句中exeSortSearchListQuery未知列'p.product_sku‘
SQL=SELECT SQL_CALC_FOUND_ROWS p.`virtuemart_product_id`
FROM `tqmux_virtuemart_products` as p
INNER JOIN `tqmux_virtuemart_products_en_gb` as l
using (`virtuemart_product_id`)
LEFT JOIN `tqmux_virtuemart_product_manufacturers`
ON p.`virtuemart_product_id` = `tqmux_virtuemart_product_manufacturers`.`virtuemart_product_id`
WHERE ((`l`.product_name LIKE "%anya%"
OR `product_sku` LIKE "%anya%"
OR `l`.`slug` LIKE "%anya%"
OR `l`.product_s_desc LIKE "%anya%"
OR `l`.`metadesc` LIKE "%anya%"
OR `p.product_sku` LIKE "%anya%"
OR `c.category_name` LIKE "%anya%"
OR `c.category_description` LIKE "%anya%"
OR `m.mf_name` LIKE "%anya%"
OR `p.product_name` LIKE "%anya%"
OR `p.product_s_desc` LIKE "%anya%")
AND `tqmux_virtuemart_product_manufacturers`.`virtuemart_manufacturer_id` = 1
AND p.`virtuemart_vendor_id` = "1" )
group by p.`virtuemart_product_id`
ORDER BY p.`created_on` DESC, `virtuemart_product_id` DESC
LIMIT 0, 20有谁可以帮我?谢谢。
更新

发布于 2016-03-14 17:20:45
我一般只在必要的时候才使用回溯词。例如在列名或保留字列名中的空格上,否则为了可读性而将它们排除在外,因此您不会遇到这些类型的错误。
`p.product_sku`
should be
`p`.`product_sku`所以..。
SELECT SQL_CALC_FOUND_ROWS p.virtuemart_product_id
FROM tqmux_virtuemart_products as p
INNER JOIN tqmux_virtuemart_products_en_gb as l
using (virtuemart_product_id)
LEFT JOIN tqmux_virtuemart_product_manufacturers tvpm
ON p.virtuemart_product_id = tvpm.virtuemart_product_id
WHERE ((l.product_name LIKE "%anya%"
OR product_sku LIKE "%anya%"
OR l.slug LIKE "%anya%"
OR l`.product_s_desc LIKE "%anya%"
OR l`.`metadesc LIKE "%anya%"
OR p.product_sku LIKE "%anya%"
OR c.category_name LIKE "%anya%"
OR c.category_description LIKE "%anya%"
OR m.mf_name LIKE "%anya%"
OR p.product_name LIKE "%anya%"
OR p.product_s_desc LIKE "%anya%")
AND tvpm.virtuemart_manufacturer_id = 1
AND p.virtuemart_vendor_id = "1" )
group by p.virtuemart_product_id
ORDER BY p.created_on DESC, virtuemart_product_id DESC 我也想知道为什么
OR p.product_sku LIKE "%anya%"
and OR product_sku LIKE "%anya%" 都在查询中。他们似乎也在做同样的事情。
https://stackoverflow.com/questions/35662135
复制相似问题