Re: PHP and inet data type - Mailing list pgsql-general

From K Parker
Subject Re: PHP and inet data type
Date
Msg-id FEKKPHJCMHADAAAA@shared1-mail.whowhere.com
Whole thread Raw
Responses Re: Re: PHP and inet data type  (Andrew Sullivan <sullivana@bpl.on.ca>)
Re: Re: PHP and inet data type  (mikeo <mikeo@spectrumtelecorp.com>)
List pgsql-general
>> Seems like the cleanest answer would be to
>> teach PHP about inet data
>> type (not to mention other extension types).

> I'd like to do that, but I don't even know
> where to begin.

I am currently using 'inet' fields in an
application that uses PHP 3.0.14, and it
works fine, e.g:

  select session_ip from acct where session_ip is not null;

  pg_FieldType() says the column is 'inet' and  the results print like this w/o any special effort:

    10.0.0.3
    10.0.0.4
    10.0.0.54
    10.0.0.158

Updates work just as easily:

    if (! ($update = pg_exec( $conn,
                "update acct set session_ip = '$REMOTE_ADDR', \
                last_login = 'now'::text where account = $data[0]")))




Join 18 million Eudora users by signing up for a free Eudora Web-Mail account at http://www.eudoramail.com

pgsql-general by date:

Previous
From: Jurgen Defurne
Date:
Subject: Re: 32KB Tuples
Next
From: Mihai Gheorghiu
Date:
Subject: Re: Dump