Re: pg_put_line() Frustration - Mailing list pgsql-php

From Michael Fuhr
Subject Re: pg_put_line() Frustration
Date
Msg-id 20050620140531.GA26064@winnie.fuhr.org
Whole thread Raw
In response to pg_put_line() Frustration  ("Simon Hewitt" <sejh79@hotmail.com>)
List pgsql-php
On Mon, Jun 20, 2005 at 01:29:47PM +0000, Simon Hewitt wrote:
>
> I am currently working on an application that will input multple lines into
> a Postgre database. I am using the following code

It's PostgreSQL or Postgres, not Postgre.

>  $sql = "COPY table_2 FROM STDIN DELIMITER AS '\t'";
>  pg_query($dbc, $sql);
>  $sql = $data1."\t".$data2."\t".implode("\t",
> $data)."\ttrue\t05-05-2005\n";
>  pg_put_line($this->dbc, $sql);
>  if(!pg_put_line($dbc, "\\N"))

The last line above attempts to add a row with a single NULL value,
so you get an error about missing data for the other columns.  What's
the purpose of that line?  Why do you sometimes use $dbc and sometimes
$this->dbc?  Do they refer to the same connection or to different
connections?

--
Michael Fuhr
http://www.fuhr.org/~mfuhr/

pgsql-php by date:

Previous
From: "Simon Hewitt"
Date:
Subject: pg_put_line() Frustration
Next
From: Christopher Kings-Lynne
Date:
Subject: Re: pg_put_line() Frustration