I have a problem with the long2ip function. With data from $_SERVEUR or a string var it's working fine, giving me the correct IP. But with a string from the database the result is 0.0.0.0 .
<?php
$varip = '127.0.0.1';
p(ip2long($varip)); //display int(2130706433)
$varip2long = ip2long($varip);
p(long2ip($varip2long)); //string(9) "127.0.0.1"
p($longIpFromDb); //display string(10) "2130706433"
p(long2ip($longIpFromDb)); //display string(7) "0.0.0.0"
p(long2ip((int)$longIpFromDb)); //display string(7) "0.0.0.0"
?>
I'm running on 64bit server, mysql 5.0.11