From 94a4f628c729fd292b94b9b35454d5640bef9fe9 Mon Sep 17 00:00:00 2001 From: t00thpick1 Date: Tue, 15 Jan 2013 22:14:05 -0500 Subject: [PATCH] Fix mcremove for sql --- .../gmail/nossr50/commands/mc/McremoveCommand.java | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/main/java/com/gmail/nossr50/commands/mc/McremoveCommand.java b/src/main/java/com/gmail/nossr50/commands/mc/McremoveCommand.java index 1f3117a07..d2ec6e1e1 100644 --- a/src/main/java/com/gmail/nossr50/commands/mc/McremoveCommand.java +++ b/src/main/java/com/gmail/nossr50/commands/mc/McremoveCommand.java @@ -51,15 +51,12 @@ public class McremoveCommand implements CommandExecutor { /* MySQL */ if (Config.getInstance().getUseMySQL()) { Database database = mcMMO.getPlayerDatabase(); - int userId = 0; - userId = database.getInt("SELECT id FROM " + tablePrefix + "users WHERE user = '" + playerName + "'"); + int success = 0; + success = database.update("DELETE FROM " + tablePrefix + "users WHERE " + tablePrefix + "users.user = '" + playerName + "'"); - if (userId > 0) { - database.write("DELETE FROM " + databaseName + "." + tablePrefix + "users WHERE " + tablePrefix + "users.id IN " + userId); + if (success > 0) { sender.sendMessage(success); - - } - else { + } else { sender.sendMessage(LocaleLoader.getString("Commands.DoesNotExist")); } }