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 581D8D1B18C for ; Thu, 8 Jul 2004 23:39:51 -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 25813-04 for ; Fri, 9 Jul 2004 02:39:51 +0000 (GMT) Received: from kimi.asti.dost.gov.ph (kimi.asti.dost.gov.ph [202.90.128.26]) by svr1.postgresql.org (Postfix) with ESMTP id 47F4FD1B181 for ; Thu, 8 Jul 2004 23:39:37 -0300 (ADT) Received: from falcon.asti.dost.gov.ph (unknown [10.10.5.200]) by kimi.asti.dost.gov.ph (Postfix) with ESMTP id 204772381C6 for ; Fri, 9 Jul 2004 10:18:18 +0800 (PHT) Subject: wouldn't insert From: "Elijah O. Alcantara" To: pgsql-php@postgresql.org Content-Type: text/plain Message-Id: <1089340768.18180.9.camel@Falcon> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.5 Date: Fri, 09 Jul 2004 10:39:28 +0800 Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200407/8 X-Sequence-Number: 2833 Hi again, Can someone help me out on this? the function I quoted below is supposed to restore the values from table temp_contactinfo to contactinfo. But it's not inserting to the contactinfo table... There are no errors whatsoever, must be something wrong with the logic somewhere... > function restore_contactinfo($connectGovPH, $ctrl_no) { > > $query_clear = "delete from contactinfo where ctrl_no = '$ctrl_no'"; > pg_Exec($connectGovPH,$query_clear); > > $query = "select * from temp_contactinfo where ctrl_no = '$ctrl_no'"; > $result = pg_Exec($connectGovPH,$query); > $num = pg_NumRows($result); > > > for($i=0;$i<$num;$i++) { > $row = pg_Fetch_Object($result,$i); > $category = $row->category; > $contact_no = $row->contact_no; > $contact_name = $row->contact_name; > $organization_name = $row->organization_name; > $address = $row->address; > $telephone = $row->telephone; > $fax = $row->fax; > $email = $row->email; > > $query2 = "INSERT INTO contactinfo > VALUES('$ctrl_no','$category','$contact_no','$contact_name','$organization_name','$address','$telephone','$fax','$email')"; > pg_Exec($connectGovPH,$query2); > > $query3 = "DELETE FROM temp_contactinfo WHERE ctrl_no = > '$ctrl_no' AND category = '$category' AND contact_no = '$contact_no'"; > pg_Exec($connectGovPH,$query3); > } > } I've searched and searched but couldn't find anything wrong with the code =( Elijah