2013-07-02 104 views
-4
UPDATE p.id_product, p.quantity, p.price,p.on_sale, p.additional_shipping_cost, p.active, 
         p.available_for_order, p.show_price, p.date_upd, 
         pl.id_product, pl.name,pl.description, pl.description_short, 
         cl.id_category, cl.name, 
         ps.is_product,ps.price 
        LEFT JOIN ps_product_lang pl ON (p.id_product = pl.id_product) 
        LEFT JOIN ps_category_lang cl ON (p.id_category_default = cl.id_category) 
        LEFT JOIN ps_product_shop ps ON (p.id_category_default = ps.id_product) 

       SET  
         p.quantity = \"$quantity\", 
         p.price = \"$price\", 
         p.additional_shipping_cost = \"$additional_shipping_cost\", 
         p.active = \"$active\", 
         p.available_for_order = \"$available_for_order\", 
         p.show_price = \"$show_price\", 
         pl.name=\"$name\", 
         pl.description=\"$description\", 
         pl.description_short=\"$description_short\", 
         p.date_upd = NOW(), 
         cs.price=\"$price\", 
         cs.date_upd = NOW() 
       WHERE p.id_product = $i 
+3

你想要什麼? 歡迎來到StackOverflow,請閱讀:http://stackoverflow.com/about – DaftDev

+0

您似乎沒有指定p是什麼表作爲別名。您似乎在p上有很長的字段列表,然後加入到ps_product_land,然後是set語句。字段的長列表不是必需的,但表格是 – Kickstart

+0

UPDATE查詢發生左連接 - 但它們很少見。 – Strawberry

回答

0

正確syntax of the update statement

update FooTable 
set fooField1 = fooValue 
where foofield2 = fooCondition 

所以,您的查詢必須看起來像這樣的事情,有沒有選擇字段 ...

UPDATE FooTable p 
        LEFT JOIN ps_product_lang pl ON (p.id_product = pl.id_product) 
        LEFT JOIN ps_category_lang cl ON (p.id_category_default = cl.id_category) 
        LEFT JOIN ps_product_shop ps ON (p.id_category_default = ps.id_product) 

       SET  
         p.quantity = \"$quantity\", 
         p.price = \"$price\", 
         p.additional_shipping_cost = \"$additional_shipping_cost\", 
         p.active = \"$active\", 
         p.available_for_order = \"$available_for_order\", 
         p.show_price = \"$show_price\", 
         pl.name=\"$name\", 
         pl.description=\"$description\", 
         pl.description_short=\"$description_short\", 
         p.date_upd = NOW(), 
         cs.price=\"$price\", 
         cs.date_upd = NOW() 
       WHERE p.id_product = $i 
+0

我收到錯誤消息。警告:未知:輸入變量超過1000.要在php.ini中增加限制更改max_input_vars。在未知的行0 – karthick

+0

這是一個PHP錯誤,而不是一個MySQL錯誤... –