Columns for IP
Moderator: General Moderators
- Ambush Commander
- DevNet Master
- Posts: 3698
- Joined: Mon Oct 25, 2004 9:29 pm
- Location: New Jersey, US
Columns for IP
Right now, I'm storing the IP string that PHP gives you in one column `ip`. But after reading about normalization, I'm having doubts. Is there a better way to do this? And what about IPv6?
Some databases provide an INET or CIDR, etc datatype that is designed for dealing with IP address and/or netmasks, etc. However often they are rather broken and just using the string is acceptable.
As the majority of the uses of the IP are atomic (you aren't splitting it into its octets for most things) it doesn't require normalization.
As the majority of the uses of the IP are atomic (you aren't splitting it into its octets for most things) it doesn't require normalization.
- Ambush Commander
- DevNet Master
- Posts: 3698
- Joined: Mon Oct 25, 2004 9:29 pm
- Location: New Jersey, US
- Ambush Commander
- DevNet Master
- Posts: 3698
- Joined: Mon Oct 25, 2004 9:29 pm
- Location: New Jersey, US