From: | Michael Fuhr <mike(at)fuhr(dot)org> |
---|---|
To: | simon(dot)hewitt(at)greenhill-ymca(dot)org |
Cc: | pgsql-php(at)postgresql(dot)org |
Subject: | Re: pg_put_line() Frustration |
Date: | 2005-06-20 14:05:31 |
Message-ID: | 20050620140531.GA26064@winnie.fuhr.org |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | 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/
From | Date | Subject | |
---|---|---|---|
Next Message | Christopher Kings-Lynne | 2005-06-20 14:36:00 | Re: pg_put_line() Frustration |
Previous Message | Simon Hewitt | 2005-06-20 13:29:47 | pg_put_line() Frustration |