我有一些问题让插入字符串工作它给我一个语法错误,但无法弄清楚为什么,任何帮助?
String sql = "INSERT INTO user VALUES ('"+ jtfEmailAddr.getText()+"'," +
"'"+ jtfPassword2.getText() + "'," +
"'"+ jtfFName.getText() +"','" + jtfSurname.getText() +"')" +
"ON DUPLICATE KEY UPDATE password='" + jtfPassword2.getText() + "'"+ `enter code here`
"firstname='" + jtfFName.getText() + "'," +
"lastname='" + jtfSurname.getText() + "'";
database.insertIntoDatabase(sql);
ERROR:
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 'rr'nn)' at line 1
字母rr nn对于测试目的而言只是随机的