String sql=" delete from rizhi where data="+data;为什么总是报错,data为varchar型.错误提示: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 ' at line 1
来源:学生作业帮助网 编辑:作业帮 时间:2024/11/28 08:00:21
String sql=" delete from rizhi where data="+data;为什么总是报错,data为varchar型.错误提示: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 ' at line 1
String sql=" delete from rizhi where data="+data;为什么总是报错,data为varchar型.
错误提示: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 ' at line 1
String sql=" delete from rizhi where data="+data;为什么总是报错,data为varchar型.错误提示: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 ' at line 1
String sql="delete from rizhi where `data`='" + data + "'";
varchar 型的值,需要用单引号包起来