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/07/06 16:55:14
![String sql=](/uploads/image/z/11959086-30-6.jpg?t=String+sql%3D%22+delete+from+rizhi+where+data%3D%22%2Bdata%3B%E4%B8%BA%E4%BB%80%E4%B9%88%E6%80%BB%E6%98%AF%E6%8A%A5%E9%94%99%2Cdata%E4%B8%BAvarchar%E5%9E%8B.%E9%94%99%E8%AF%AF%E6%8F%90%E7%A4%BA%EF%BC%9AYou+have+an+error+in+your+SQL+syntax%3B+check+the+manual+that+corresponds+to+your+MySQL+server+version+for+the+right+syntax+to+use+near+%27+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;为什么总是报错,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 型的值,需要用单引号包起来