Best way to store an IPv6 in UNKNOWN DB?
问题 I know that this question has been asked quite a few times, but I could not find anywhere a final resolution; so here goes: How do you store an IP (both IPv4 and IPv6) using best-practice, within a DB, without knowing the DB? This in case for DB abstraction purposes, such as PHP PDO. On a minor note, I have PHP 5.2.17, as I needed PEAR on windows. People have been suggesting to store it as a varbinary(16) and use mysql functions inet6_ntop and inet6_pton to pass IPs back and forth as strings;