Quote:
Originally Posted by Tech Manager
You can follow Wige's advice and store the IP as a string (text). I prefer storing the IP address in decimal (integer) as it makes it easier to work with later.
I wrote a tutorial called Decimal and Binary Conversion of IP Addresses. But you can use MySQL commands to easily convert the data. For instance if you retrieved the IP you can use the inet_aton('$ip') command to convert the insert the IP Address ($ip) into decimal and then add the data into the database. You can convert the Decimal Address back to octets by using inet_ntoa.
|
Thanks! This is good resource as I never think of it. Now I can add this in my database for those login in my private access area.