Quote:
Originally Posted by wwzw
My IP address data like this:
0.0.0.0 0.255.255.255 IANA reserved address
......
192.168.0.0 192.168.255.255 Lan
......
|
Those are start and end ips.
If you convert them to ip and mask:
0.0.0.0 255.0.0.0 IANA reserved address
192.168.0.0 255.255.0.0 Lan
Then you can convert them to 4bytes signed int and insert to your table (let's say columns are network_address, network_mask, network_name).
and then you can do this:
PHP Code:
SELECT `network_name` FROM `table_name` WHERE `network_mask` & '%d' = `network_address`;
__________________