public static String checkBanned(String ip) throws UnknownHostException {
		String query = "SELECT * FROM `" + mysql_db +"`.`banlist`";
		try (Connection con = getConnection(); PreparedStatement pst = con.prepareStatement(query)) {
			ResultSet r = pst.executeQuery();
			while (r.next()) {
				String decIP = r.getString("ip");
				if (decIP.contains("*")) {
					if (Functions.inRange(ip, decIP))
						return decIP;
				}
				else if (decIP.equals(ip))
					return decIP;
			}
			return null;
		}  catch (SQLException e) {
			e.printStackTrace();
			logMessage(LOGLEVEL_IMPORTANT, "Could not check ban.");
			return null;
		}
	}