我已经做出了一条在共享服务器上正常工作的sql语句。但是由于我已将数据库迁移到本地数据库
显示#1064-您的SQL语法有错误
INSERT INTO shops (shop_name, googleid, address, city, country, open_now, logogroup, idshopgroup, shop_group, image, website)
select '$shopname', '".$key["googleid"]."','$address','".$key["city"]."',
'".$key["country"]."', '".$key["open_now"]."','".$key["logo"]."','".$key["groupid"]."','$groupname','".$key["photo_reference"]."', '".$key["website"]."'
WHERE NOT EXISTS (
SELECT googleid FROM shops WHERE googleid = '".$key["googleid"]."'
) LIMIT 1;
答案 0 :(得分:0)
我通过在“ WHERE”子句之前添加“ from'tablename'”来解决了问题