Well.. here i am again with another buggy question... :)
Using a traffic counter which are using SQL DB for storing unique IP's.
Now i got this MASSIVE list of locations which got different ip-ranges.
What i basically need, is assistance with how to do this in the best way.
I have to include it in the SQL query so that the last <td> is displaying the correct location for the ip-address.. (which means is between the ip-range ex : 162.156.72.000 and 162.156.73.000)
The whole net got the same first 2 parts of the ip : 162.156.XXX.XXX, but the 2 last parts will ofcourse vary.
I'm not sure how to do this the best way, since there's about 100 different ip-ranges, so therefore maybe 100 "if, then, else if's" or "Case"'s ?
Might be a much better way but cannot figure out a better way though..
Developed in A.S.P. btw..
Can anyone enlighten me on this ?
------ WANNA-BE CODE -------
ipLocation = IF fieldname BETWEEN 162.156.72.000 AND 162.156.73.000 THEN "Stockholm" IF fieldname BETWEEN etc.etc.etc..
------------------
Best regards
MiradorSounds like you need another table, which stores the location name for each IP or IP range. Then just join to that.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment