What field types and compare "equation" is best to use for the following comparison, equivalent to the standard form like 10.10.10.0/24
(I use PHP)
Given an incoming IP address $ThisIPAddress, converted to 32-bit integer,
is it in tblBlockAddresses (IPBase, Mask)
SELECT ID FROM tblBlockAddresses WHERE ($ThisIPAddress AND Mask)=(IPBase AND Mask)
where AND should be a bitwise AND
Note that I'd like to mask both before comparing
thanks
Start Free Trial