[EDIT] Problem solved. Thanks anyways!
I'm trying to create a simple IP ban script, just a little function that I can place in my webpages. I dont want to modify my .htaccess pages or just put the IPs directly in the code, because I want some admins on my site who don't have access to the code to be able to add IPs as they see fit if/when I am unavailable. I created a mysql table called bans, which has the field ip. I have something set up so it will add IPs into the table, and its working. However, when I try to check it against the IPs for the current user, its not working. I've tried a BUNCH of different things, so I'm REALLY looking for some help. Thanks so much.
The function, at present:
$addr = mysql_db_query("blah","SELECT ip FROM bans;",$database);
$ip = $_SERVER['REMOTE_ADDR'];
while ($ip = mysql_fetch_assoc($addr)) {
print ("Error Message");
exit;
}