我已将CMS移至新服务器,并且我在某些页面上出错:
无法执行SELECT语句[SELECT SQL_CALC_FOUND_ROWS DISTINCT shop_products.id,shop_products.user_id,shop_products.route_id,shop_products.external_id,shop_products.active,shop_products.hit,shop_products.hot,shop_products.action,shop_products.archive,shop_products。 brand_id,shop_products.category_id,shop_products.related_products,shop_products.old_price,shop_products.created,shop_products.updated,shop_products.views,shop_products.added_to_cart_count,shop_products.enable_comments,shop_products.tpl,shop_products_i18n.id,shop_products_i18n.locale,shop_products_i18n.name, shop_products_i18n.short_description,shop_products_i18n.full_description,shop_products_i18n.meta_title,shop_products_i18n.meta_description,shop_products_i18n.meta_keywords,IF(sum(shop_product_variants.stock)> 0,1,0)AS allstock FROM shop_products INNER JOIN shop_product_categories ON(shop_products.id = shop_product_categories .product_id)INNER JOIN shop_category ON(shop_products。 category_id = shop_category.id)INNER JOIN shop_products_i18n ON(shop_products.id = shop_products_i18n.id AND shop_products_i18n.locale =:p1)INNER JOIN shop_product_variants ON(shop_products.id = shop_product_variants.product_id)LEFT JOIN shop_brands ON(shop_products.brand_id = shop_brands。 id)WHERE shop_product_categories.category_id =:p2 AND shop_products.active =:p3 AND shop_products.archive =:p4 AND shop_category.active =:p5 GROUP BY shop_products.id ORDER BY allstock DESC,shop_product_variants.price DESC,shop_products.id DESC LIMIT 32]
我也在PhpmyAdmin中完成了这个请求并得到了这样的错误:
意外的角色。 (在1093号位置附近“:”)
请告诉我,为什么一台服务器上没有这样的错误,但是在另一台服务器上显示错误?
答案 0 :(得分:1)
它抱怨这次加入
INNER JOIN shop_products_i18n ON (shop_products.id=shop_products_i18n.id AND shop_products_i18n.locale = :p1)
确保您将p1
作为参数传递或加入特定列而不是传递参数?