Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/356.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 您的SQL语法有错误;检查与MySQL服务器对应的手册_Java_Mysql - Fatal编程技术网

Java 您的SQL语法有错误;检查与MySQL服务器对应的手册

Java 您的SQL语法有错误;检查与MySQL服务器对应的手册,java,mysql,Java,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.19

我收到这个错误:

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%
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%**,**"); <- The error is the following comma. Try to erase it and compile again.
sb.append(") ON DUPLICATE KEY UPDATE ");
sb.append("FIRSTIP='%firstip%',");
sb.append("IP='%ip%',");
sb.append("MUTE=%mute%,");
sb.append("MUTEREASON=%mutereason%;");
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%;");