This script works great. I call it in top of my scripts. But if a user that is NOT banned enters the site they get:
Notice: Trying to get property of non-object
If there is no matching row, then $row will be FALSE. You should add if ($row) around everything after mysql_fetch_object.
$row
if ($row)
mysql_fetch_object