mirror of
				https://github.com/mcMMO-Dev/mcMMO.git
				synced 2025-11-03 18:43:43 +01:00 
			
		
		
		
	Fix mcremove for sql
This commit is contained in:
		@@ -51,15 +51,12 @@ public class McremoveCommand implements CommandExecutor {
 | 
				
			|||||||
        /* MySQL */
 | 
					        /* MySQL */
 | 
				
			||||||
        if (Config.getInstance().getUseMySQL()) {
 | 
					        if (Config.getInstance().getUseMySQL()) {
 | 
				
			||||||
            Database database = mcMMO.getPlayerDatabase();
 | 
					            Database database = mcMMO.getPlayerDatabase();
 | 
				
			||||||
            int userId = 0;
 | 
					            int success = 0;
 | 
				
			||||||
            userId = database.getInt("SELECT id FROM " + tablePrefix + "users WHERE user = '" + playerName + "'");
 | 
					            success = database.update("DELETE FROM " + tablePrefix + "users WHERE " + tablePrefix + "users.user = '" + playerName + "'");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            if (userId > 0) {
 | 
					            if (success > 0) {
 | 
				
			||||||
                database.write("DELETE FROM " + databaseName + "." + tablePrefix + "users WHERE " + tablePrefix + "users.id IN " + userId);
 | 
					 | 
				
			||||||
                sender.sendMessage(success);
 | 
					                sender.sendMessage(success);
 | 
				
			||||||
 | 
					            } else {
 | 
				
			||||||
            }
 | 
					 | 
				
			||||||
            else {
 | 
					 | 
				
			||||||
                sender.sendMessage(LocaleLoader.getString("Commands.DoesNotExist"));
 | 
					                sender.sendMessage(LocaleLoader.getString("Commands.DoesNotExist"));
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user