我试图在我的代码中使用它之前在phpmyadmin中使我的查询正确并且我得到以下错误,虽然我知道列存在
Error
SQL query:
UPDATE
tendesig_zink_dev.euid0_hikashop_product
SET
tendesig_zink_dev.euid0_hikashop_product.product_quantity = tendesig_zink_production.euid0_hikashop_product.product_quantity
WHERE
tendesig_zink_dev.euid0_hikashop_product.product_id = tendesig_zink_production.euid0_hikashop_product.product_id
MySQL said: Documentation
#1054 - Unknown column 'tendesig_zink_production.euid0_hikashop_product.product_id' in 'where clause'
答案 0 :(得分:2)
您收到未知列错误的原因是您的查询不知道表tendesig_zink_production.euid0_hikashop_product
。尝试使用此查询
UPDATE
tendesig_zink_dev.euid0_hikashop_product, tendesig_zink_production.euid0_hikashop_product
SET
tendesig_zink_dev.euid0_hikashop_product.product_quantity = tendesig_zink_production.euid0_hikashop_product.product_quantity
WHERE
tendesig_zink_dev.euid0_hikashop_product.product_id = tendesig_zink_production.euid0_hikashop_product.product_id