Posted by Jim Michaels on 03/19/06 07:30
"frizzle" <phpfrizzle@gmail.com> wrote in message
news:1140030457.211013.101930@g44g2000cwa.googlegroups.com...
> Hi there,
>
> I'm saving ip addresses of blocked visitors into a mySQL DB.
> The function with wich i retrieve the address is below this message.
>
> What i wonder is, if it's ok to remove the dots from the ip address,
> and only
> save the numbers into the database. I assume it will be quicker to
> compare.
> But i don't know if it could mess up ip addresses. E.g. confuse
> 12.34.56.78 with 123.45.6.78
>
> Frizzle.
try the database's built-in functions.
SELECT INET_ATON('209.207.224.40');
-> 3520061480
SELECT INET_NTOA(3520061480);
-> '209.207.224.40'
[Back to original message]
|