Best field type for storing various of data to MySQL table

IP address:

Use: INT 4 Unsigned

Convert the IP address to 32-bit unsigned integer before storing it to table.
You can use built in MySQL INET_ATON() and INET_NTOA() function to convert this.
Sample:
INSERT INTO table SET ip = INET_ATON('192.168.0.1')

——————————

Unix timestamp:

Use: INT

——————————

No Comments

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: