When the result is 1 then the IP is banned otherwise not banned (e.g. no results).
Edit: you can also return the fields (ip, name, reason, admin) for showing the kick message.PHP Code:
SELECT 1 FROM bans WHERE ip = INET_ATON('" + stripstring(self getip()) + "') LIMIT 1