[EMAIL PROTECTED] wrote:
>
> I have to put in my table a new type of data:
> IP and NETADDRES
> how can I do?
> what is (for you) the best way to do it?
>
> I think I'll make 4 INTEGER ( an IP is made by 4 number eg. 121.33.122.133)
>
> But then I have to get the little Net to which belong an IP
> I mean:
> if in my database there is:
> 121.33.122.100
> 121.33.00.00
> 121.33.00.00
>
> and I have to know which Net belong the IP 121.33.122.143
> the right choise is 121.33.122.100
> so I have to order this column in right way!?!?
>
> but how can I do than?!?!
> Thank you in advance for your help.
>
> I think to do that by ordering the column then get the first row taken by the
> follow query:
>
> select * from name_table where IP1>INT1, IP2>INT2, IP3>INT3, IP4>INT4;
>
> where IPx is the fisrt, second,... part of an IP
> and INT1, INT2... is the four columns in my db.
>
> I hope I'm clear and I'm very sorry for my little english.
> I thak very much all people had read this mail!
>
> Mario.
>
> [EMAIL PROTECTED]
>
Check the misc functions of the manual for INET_NTOA and INET_ATON.
---------------------------------------------------------------------
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