Interesting. After hlaf a minute an idea came to my brain. create table blocked( from_ip bigint unsigned, to_ip bigint unsigned);
<?php list($is_bad)=mysql_fetch_array(mysql_query("select count(*) from blocked where $REMOTE_ADDR>=from_ip and $REMOTE_ADDR<=to_ip;")); ?> Hope this helps. $REMOTE_ADDR have to be integer => use ip2long(). For single IP the ints in the row are equivalent. from_ip and to_ip gives you range. Andrey Hristov IcyGEN Corporation BALANCED SOLUTIONS http://www.icygen.com ; On Friday 05 October 2001 21:12, you wrote: > What would be the most effective way to create blocking of users by ip > using mysql. In such as way that the "blocking system" allows for masks > such as 24.127.89.* > 24.*.*.* > etc... > > So far the what I've come up with is either breaking the ip into 4 INTs and > then running an SQL query to check if that ip is found in "Blocked Users" > table. > > Replies would be appriciated > > Prottoss -- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]