Mysql更新查询 - 具有相同名称的多个左连接

时间:2013-07-02 17:49:50

标签: mysql mysqldump mysql-workbench mysql-error-1064

$sqldt1 = "UPDATE `ps_product` 
SET     
    `quantity` = $quantity, 
    `price` = $price, 
    `additional_shipping_cost` = $additional_shipping_cost,
    `active` = $active, 
    `available_for_order` = $available_for_order, 
    `show_price` = $show_price
WHERE `id_product` = $i";
mysql_query($sqldt1) or die("error in qr1; " . mysql_error());

$sqldt2 = "UPDATE `ps_product_lang` SET `name`=\"$name\", 
    `description`=\"$description\",
    `description_short`=\"$description_short\"
WHERE `id_product`=\"$id_p\" ";
mysql_query($sqldt2) or die("error in qr2; " . mysql_error());


$sqldt3 = "UPDATE ps_product SET date_upd = NOW() WHERE `id_product` = $i";
mysql_query($sqldt3) or die("error in qr3; " . mysql_error());


$sqldt4 = "UPDATE ps_product_shop SET `price`=\"$price\" WHERE `id_product` = $i";
mysql_query($sqldt4) or die("error in qr4; " . mysql_error());

$sqldt5 = "UPDATE ps_product_shop SET date_upd = NOW() WHERE `id_product` = $i";
mysql_query($sqldt5) or die("error in qr5; " . mysql_error());                                                                            

这4个查询单独工作正常,我需要使用

连接所有单一查询
LEFT JOIN ps_category_lang cl ON (p.id_category_default = cl.id_category) 

这是Prestashop更新查询

0 个答案:

没有答案