即時得到這個錯誤:你的SQL語法有錯誤;檢查對應於你的MySQL手冊斷絕
com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: 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 ') ON DUPLICATE KEY UPDATE FIRSTIP='83.242.83.190',IP='83.242.83.190',MUTE='0',MU' at line 1
我的代碼:
sb.append("INSERT INTO `TOOLS_USERS` VALUES(");
sb.append("'%name%',");
sb.append("'%firstip%',");
sb.append("'%ip%',");
sb.append("%mute%,");
sb.append("%mutereason%,");
sb.append("TIME=%time%,");
sb.append(") ON DUPLICATE KEY UPDATE ");
sb.append("FIRSTIP='%firstip%',");
sb.append("IP='%ip%',");
sb.append("MUTE=%mute%,");
sb.append("MUTEREASON=%mutereason%;");
嘗試 '%mutereason%';但仍然沒有工作和相同的錯誤:v 任何想法? :d
你有一個錯誤的逗號 –
'TIME =%time%'後面還有一個逗號, ' – Barmar