Is there a way to use something like in_array() to see if a variable is in a MySQL array?
Something like (incomplete for simplicity):
I have it working using a while loop, but I'm hoping there is a simpler way to do it.
Something like (incomplete for simplicity):
Code:
$ip = @$REMOTE_ADDR;
$result = mysql_query("SELECT ip_address from banned_ip");
if (in_array($ip,$result)) {
echo 'UNAUTHORIZED ACCESS';
exit();
}
I have it working using a while loop, but I'm hoping there is a simpler way to do it.