Jump to content

Best way to store IP Address in database?


rockinaway

Recommended Posts

I've been doing some research and I was wondering what the best way is to store IP addresses in a MySQL database, and what would be the field type and length?

 

I've seen that you can use the inet_aton() function but supposedly this doesn't support IPv4. So is there a workaround using these functions?

 

Alternatively, if I was to just store the IP address as it is, what type of field and length would I be looking at? I've read somewhere that 45 is the max?

 

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.