| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> comp.databases.theory -> Encoding string for use in sorting and query
I am trying to create a database in mySQL to track usage of IP addresses. However, not being an ace database type, I am stumped as to how to encode a string such that I can sort addresses and query accurately for a range. If I have the IP address in dotted decimal notation represented as a string, does anybody know of a way to easily encode that data for storage in another field? The kicker is I also need to be able to decode that string back into a dotted decimal notation IP address. PHP has a simple function called ip2long() and the opposing long2ip() that do the trick, but I don't necessarily want to do all the encoding/decoding within a php script. Any help would be fantastic.
Thanks,
Joe Received on Fri Jul 20 2001 - 12:34:26 CDT
![]() |
![]() |