Okay thanks. Switching the int in mysql to varchar did the trick
Sorry to bump, but whats the main difference between inet_atom and storing the ip?
Is there performance improvements or does it not affect ip changes?Code:inet_aton() converts the Internet host address cp from the IPv4 numbers-and-dots notation into binary form (in network byte order) and stores it in the structure that inp points to. inet_aton() returns nonzero if the address is valid, zero if not.
Even with few manipulations (inet functions) IP is the same, but it's stored as number.
Single IP with inet_aton can be saved in database as an integer in 4 bytes.
If you would like to save an IP as varchar you would need to use varchar(15). If the charset of the text is ASCII it store 15 x 1 byte + 1 byte to save maximum length of text.
Note: Even if ip would be 1.2.3.4, varchar uses maximum size it has (16 bytes)
Conclusion: Each stored IP is 4 times larger when using varchar.
Performance? More data more reading.
If I'm wrong, correct me xD.
Ni3ls (28th August 2016)
But I doubt it would have any noticable perfomance impact using strings over ints in CoD2
Yeah, guess we could count the difference in microseconds
With inet_aton it's easier to do subnet operations
"Does not work" is an error report for a bug between keyboard and chair.
All hail Artie Effem
what kind of subnet operations?
like 1.2.3.0/24
"Does not work" is an error report for a bug between keyboard and chair.
All hail Artie Effem