Thread

  1. Re: PHP and inet data type

    K Parker <kparker@eudoramail.com> — 2000-06-07T18:47:49Z

    >> 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
    
    
  2. Re: Re: PHP and inet data type

    Andrew Sullivan <sullivana@bpl.on.ca> — 2000-06-07T19:53:51Z

    On Wed, Jun 07, 2000 at 11:47:49AM -0700, K Parker wrote:
    > >> 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:
    
    Hmm.  PHP complained when I did it, claiming it didn't support that data
    type.  Thanks for this, though.  It must be more incompetence on my part. 
    I'm getting tired of learning from experience!
    
    -- 
    Andrew Sullivan                                      Computer Services
    <sullivana@bpl.on.ca>                        Burlington Public Library
    +1 905 639 3611 x158                                   2331 New Street
                                       Burlington, Ontario, Canada L7R 1J4
    
    
  3. Re: Re: PHP and inet data type

    mikeo <mikeo@spectrumtelecorp.com> — 2000-06-08T21:47:25Z

    just a curiosity question...is the pg_FieldType() function
    something you wrote yourself?  i was unable to find it and,
    as i'm new to postgres, want to know everything yesterday...  :)
    
    mikeo 
    
    
    >
    >  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
    >
    
    
  4. Re: Re: PHP and inet data type

    Ron Peterson <rpeterson@yellowbank.com> — 2000-06-09T15:50:52Z

    mikeo wrote:
    > 
    > just a curiosity question...is the pg_FieldType() function
    > something you wrote yourself?
    
    It's a PHP function.
    
    -Ron-