check if ip address is present between the given range of ip addresses in the database
Posted on 2013-10-22
Here is my problem.
I have a db table that has following columns:
ip_from | ip_to | country
and the values present in these columns are:
22.214.171.124 | 126.96.36.199 | japan
now i have some value in a variable say $ip_to_look that contains some value of ip address, now how will i check that the ip in variable $ip_to_look is present between the range of values present in the table in columns ip_from and ip_to.
To do this what would be my database structure.
Please help me to solve this problem, i will be very thankful.