这里rowOwn,columnOwn,areaNameOwn的类型为array,后台用String rowOwn=request.getParameter("rowOwn");是接收不到的 ,其中request.getParameter的参数可以为ajax中data的value名
因为它们的数据类型不同。后台接收到的为字符串。而前台传过去的为数组,所以需要把数组转换为字符串
$.ajax({
type: "post",
url: "selectContent",
async: true,
data: {
value: value,
rowOwn: rowOwn[0].toString(),
columnOwn: columnOwn[0].toString(),
areaNameOwn: areaNameOwn[0].toString()
},
success: function() {
console.log(areaNameOwn + "区" + rowOwn + "排" + columnOwn + "列" + value);
},
error: function() {
alert("error");
}
});
mysql 保留关键字row ,column
若用上面的关键字来操作sql语句话报错
例如
update student set row="十" column="一" where age="28" and name="mike";
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 'column="一" where age="28" and name="mike"' at line 1