Justtechjobs.com Find a programming school near you






Online Campus Both


php-general | 2001092

Re: [PHP] MySQl IP Address Storage From: Felix (felix <email protected>)
Date: 09/20/01

Thank you very much.

Felix
----- Original Message -----
From: "Jason Bell" <jbell <email protected>>
To: "PHP list" <php-general <email protected>>
Sent: Thursday, September 20, 2001 12:49 PM
Subject: Re: [PHP] MySQl IP Address Storage

> Felix,
>
> Just to save you the headache that I encountered, the column that you
plan
> to store your IP address in needs to be an unsigned integer when using
> INET_ATON and INET_NTOA
>
> If it's not, all addresses stored will come out as 127.0.0.0 (I think that
> was what it was...).
>
> Also, these are MySQL functions, not PHP functions. Not sure if you knew
> that already, but it wasn't specified on the list...
>
>
> INET_ATON converts from Decimal IP and INET_NTOA converts back to Decimal
> IP, so you'd use it like this:
>
> INSERT INTO mytable (ipaddress) VALUES (INET_ATON('192.168.1.1'));
>
> SELECT INET_NTOA(ipaddress) FROM mytable;
>
> Make sense?
>
> ----- Original Message -----
> From: "Felix" <felix <email protected>>
> To: "Robert Covell" <rcovell <email protected>>; "PHP list"
> <php-general <email protected>>
> Sent: Thursday, September 20, 2001 11:29 AM
> Subject: Re: [PHP] MySQl IP Address Storage
>
>
> > Thank you Robert.
> > Felix
> > ----- Original Message -----
> > From: "Robert Covell" <rcovell <email protected>>
> > To: "Felix" <felix <email protected>>; "PHP list"
> <php-general <email protected>>
> > Sent: Thursday, September 20, 2001 10:55 AM
> > Subject: RE: [PHP] MySQl IP Address Storage
> >
> >
> > > INET_ATON
> > >
> > > and
> > >
> > > INET_NTOA
> > >
> > > -----Original Message-----
> > > From: Felix [mailto:felix <email protected>]
> > > Sent: Thursday, September 20, 2001 11:49 AM
> > > To: PHP list
> > > Subject: [PHP] MySQl IP Address Storage
> > >
> > >
> > > Hello all
> > >
> > > Can anyone suggest their best idea for a way to store IP addresses in
a
> > > MySQL Database?
> > >
> > > Felix
> > >
> > >
> > > --
> > > PHP General Mailing List (http://www.php.net/)
> > > To unsubscribe, e-mail: php-general-unsubscribe <email protected>
> > > For additional commands, e-mail: php-general-help <email protected>
> > > To contact the list administrators, e-mail:
php-list-admin <email protected>
> > >
> > >
> > >
> > > --
> > > PHP General Mailing List (http://www.php.net/)
> > > To unsubscribe, e-mail: php-general-unsubscribe <email protected>
> > > For additional commands, e-mail: php-general-help <email protected>
> > > To contact the list administrators, e-mail:
php-list-admin <email protected>
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: php-general-unsubscribe <email protected>
> > For additional commands, e-mail: php-general-help <email protected>
> > To contact the list administrators, e-mail: php-list-admin <email protected>
> >
> >
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe <email protected>
> For additional commands, e-mail: php-general-help <email protected>
> To contact the list administrators, e-mail: php-list-admin <email protected>

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: php-general-unsubscribe <email protected>
For additional commands, e-mail: php-general-help <email protected>
To contact the list administrators, e-mail: php-list-admin <email protected>