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/