Julian Halliwell
Member since Jan 29, 2010
- Profile: /members/5298-julian-halliwell.htm
- URL: http://simplicityweb.co.uk
- Comments: 3
Recent Blog Comments By Julian Halliwell
-
Converting An IP Address To An Integer Using MySQL (Thanks Julian Halliwell)
Posted on Feb 8, 2010 at 4:19 PM
@Rob Yes, as I said it's CF9 that seems to return byte arrays from this and certain other MySQL functions such as GREATEST(). To run Ben's code as is you just need to enable multiple queries in your CF data source: allowMultiQueries=true.... read more »
-
Converting An IP Address To An Integer Using MySQL (Thanks Julian Halliwell)
Posted on Feb 2, 2010 at 9:21 AM
You're very welcome, Ben. I learnt about these functions in the excellent O'Reilly book "High Performance MySQL". The fact that you get a byte array back from the INET_NTOA() function seems to be specific to CF9, or the MySQL drivers that ship with it. On CF8 you get a string as expected. This seem... read more »
-
Converting IP Addresses To And From Integer Values With ColdFusion
Posted on Jan 29, 2010 at 3:33 AM
Just as a footnote, Ben, MySQL has two handy functions: INET_ATON() to convert in IP string to int, and INET_NTOA() to go the other way. Saving IPs as ints rather than varchars can significantly reduce the storage size of a table with a lot of rows. Access logging tables where you're capturing vis... read more »