1
我試圖將值添加到所謂chests
特定的用戶,當我執行此方法:MySQL錯誤 - 不正確DOUBLE值:「箱子」
public void addAmm(Player player, int amount, DataType type) {
try {
Statement sql = mySql.getConnection().createStatement();
sql.executeUpdate("UPDATE `playerinfo` SET `chests`= '" + amount + "' + 'chests' WHERE Username='" + player.getName() + "';");
sql.close();
} catch (SQLException e) {
e.printStackTrace();
}
}
它給我這個錯誤:
[12:26:14 WARN]: com.mysql.jdbc.MysqlDataTruncation: Data truncation: Truncated
incorrect DOUBLE value: 'chests'