Convert IPv6 to binary without INET6_ATON()
Description: I am creating an IP class that first finds the visitor's IP address (using $_SERVER['REMOTE_ADDR'] or getenv('REMOTE_ADDR') ), makes sure it's a valid IP, set's the version (IPv4 or IPv6) to a data member, then it either returns the IP address, or returns the SQL parameter if it's for an SQL query (see createQueryParam() function below for available returns). Question: If the server is not running MySQL 5.6.3+, how can I convert a IPv6 binary stored in the database table ( varbinary(16) ) to a string? For an IPv6 and on systems not running MySQL 5.6.3+ I'd like to return a MySQL