0
我有一个奇怪而难以理解的情况。我无法用我的php脚本中的查询更新ENUM字段。在海蒂执行,它完美的作品。有人能帮我理解为什么吗?更新MySQL中的ENUM字段
这是查询:
UPDATE ps_specific_price
SET reduction='0.5', reduction_type='percentage'
WHERE id_product='249' and id_group='3'
枚举字段是reduction_type(数量,百分比)
下面是操作的代码:
if($valori['perc_riv']==0){
$sql_perc_riv="update ps_specific_price set reduction='0', reduction_type='amount' where id_product='".$valori[id_product]."' and id_group='3'";
} else {
$riduzione=(float)$valori['perc_riv']/100;
$sql_perc_riv="update ps_specific_price set reduction_type='percentage' WHERE id_specific_price='2031'"; // where id_product='".$valori[id_product]."' and id_group='3'";
}
$sttpercriv = $conn->prepare($sql_perc_riv);
$sttpercriv->execute();
请发布您的PHP代码 – 2014-10-01 10:52:48
你得到的错误是什么 – 2014-10-01 10:53:01
我没有错误。就像查询跳过了...呃... – fsalvaggio 2014-10-01 10:59:12