sql语句"insert into " . TABLE_PRODUCT_TO_EFFECT. "
(product_id, effect_name)
values ('" . (int)$products_id . "', '" . $value . "') where not exists(select *from " . TABLE_PRODUCT_TO_EFFECT. " where product_id='" . (int)$products_id . "' and effect_name='" . $value . "')"
报错,
报错信息如下:
1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'where not exists(select *from product_to_effect where product_id='188' and effe' at line 3
in:
[insert into product_to_effect (product_id, effect_name) values ('188', '关节炎') where not exists(select *from product_to_effect where product_id='188' and effect_name='关节炎')]
(product_id, effect_name)
values ('" . (int)$products_id . "', '" . $value . "') where not exists(select *from " . TABLE_PRODUCT_TO_EFFECT. " where product_id='" . (int)$products_id . "' and effect_name='" . $value . "')"
报错,
报错信息如下:
1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'where not exists(select *from product_to_effect where product_id='188' and effe' at line 3
in:
[insert into product_to_effect (product_id, effect_name) values ('188', '关节炎') where not exists(select *from product_to_effect where product_id='188' and effect_name='关节炎')]
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货