关于mysql提示error in your SQL syntax的解决办法

Error: ER_PARSE_ERROR: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '' at line 1

提示这种很可能是出现了insert语句中value缺少值的错误

应该在插入之前判断值是否为空

const data = await crawl(city,area, citydiping, cityid,area_id, i);
			if(data.length>0){
				await insertData(connection, city, data);
			}

猜你喜欢

转载自blog.csdn.net/zhtxilyj/article/details/130632041