X-Original-To: pgsql-php-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 752725280B for ; Mon, 20 Jun 2005 10:29:53 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 39347-07 for ; Mon, 20 Jun 2005 13:29:44 +0000 (GMT) Received: from hotmail.com (bay103-f2.bay103.hotmail.com [65.54.174.12]) by svr1.postgresql.org (Postfix) with ESMTP id 15F905285C for ; Mon, 20 Jun 2005 10:29:43 -0300 (ADT) Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC; Mon, 20 Jun 2005 06:29:47 -0700 Message-ID: Received: from 65.54.174.202 by by103fd.bay103.hotmail.msn.com with HTTP; Mon, 20 Jun 2005 13:29:47 GMT X-Originating-IP: [65.54.174.202] X-Originating-Email: [sejh79@hotmail.com] X-Sender: sejh79@hotmail.com Reply-To: simon.hewitt@greenhill-ymca.org From: "Simon Hewitt" To: pgsql-php@postgresql.org Subject: pg_put_line() Frustration Date: Mon, 20 Jun 2005 13:29:47 +0000 Mime-Version: 1.0 Content-Type: text/plain; format=flowed X-OriginalArrivalTime: 20 Jun 2005 13:29:47.0797 (UTC) FILETIME=[20F17450:01C5759C] X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=2.266 tagged_above=0 required=5 tests=DNS_FROM_RFC_ABUSE, DNS_FROM_RFC_POST, FROM_ENDS_IN_NUMS, MSGID_FROM_MTA_HEADER X-Spam-Level: ** X-Archive-Number: 200506/15 X-Sequence-Number: 3174 Hi all, I am currently working on an application that will input multple lines into a Postgre database. I am using the following code $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")) { pg_end_copy($dbc); $error_message('Could not enter details'); } else { pg_end_copy($this->dbc); unset($data); } This gives me an example line like 57 BELF 254 0 10877 5138 0 0 true 05-05-2005 To go into a table with fields INT, CHAR(4) INT, INT, INT, INT, INT, INT, BOOL, DATE However, its not going in... I'm getting an error ERROR: missing data for column "col2" With no data being inserted. If anyone could point out where I'm going wrong I'd be forever in their debt Thanks Simon