All,

I have a table which includes IP addresses converted from dotted quads to signed integers using PHP's ip2long() function.

To greatly simplify some of my code, I want to convert these signed integers to IP addresses on my MySQL server.

The problem I'm up against is that PHP's ip2long uses signed integers, and inet_aton uses unsigned integers. If all my IP addresses were below 127.255.255.255, this would be fine :)

Documentation suggests that converting signed to unsigned (and vice versa) is available in MySQL 4.0.2 through the CAST() function, but I'm running 3.23.54 at present.

Can anybody help me?

Best wishes,


Peter.


---------------------------------------------------------------------
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/ (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to