pg.ddx.io  pgsql-php@postgresql.org mailing list archive  
help / color / mirror / Atom feed
column insert
2+ messages / 2 participants
[nested] [flat]

* column insert
@ 2002-05-02 15:24  P. Jourdan <pippo@videotron.ca>
  0 siblings, 1 reply; 2+ messages in thread

From: P. Jourdan @ 2002-05-02 15:24 UTC (permalink / raw)
  To: pgsql-php

I have to insert 2 columns into an existing database that seems to be 
altered after a restore. I do not know what datatype should be entered for 
"path" and for "referer". The others are int4 and timestamptz for when_stamp.
Here is the code:
/*
      * Statistics: write page view
      */
     if($loglevel>=1) {
	sqlquery("
	    insert into visits (session_id,page_id,when_stamp,path,referer)
	    select session_id,$page_id,'now','$REQUEST_URI','$HTTP_REFERER'
	    from session
	    where hash='$sid'");
     }
  Thanks for any help.
Phil Jourdan




^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: column insert
@ 2002-05-02 21:31  Scott Marlowe <scott.marlowe@ihs.com>
  parent: P. Jourdan <pippo@videotron.ca>
  0 siblings, 0 replies; 2+ messages in thread

From: Scott Marlowe @ 2002-05-02 21:31 UTC (permalink / raw)
  To: P. Jourdan <pippo@videotron.ca>; +Cc: pgsql-php

On Thu, 2 May 2002, P. Jourdan wrote:

> I have to insert 2 columns into an existing database that seems to be 
> altered after a restore. I do not know what datatype should be entered for 
> "path" and for "referer". The others are int4 and timestamptz for when_stamp.
> Here is the code:
> /*
>       * Statistics: write page view
>       */
>      if($loglevel>=1) {
> 	sqlquery("
> 	    insert into visits (session_id,page_id,when_stamp,path,referer)
> 	    select session_id,$page_id,'now','$REQUEST_URI','$HTTP_REFERER'
> 	    from session
> 	    where hash='$sid'");
>      }

You're probably best off using text type.  Try this:

alter table visits add path text;
alter table visits add referer text;

That should get ya there.





^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2002-05-02 21:31 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2002-05-02 15:24 column insert P. Jourdan <pippo@videotron.ca>
2002-05-02 21:31 ` Scott Marlowe <scott.marlowe@ihs.com>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox