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 7FDFED1B26E for ; Sun, 11 Jul 2004 23:17:24 -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 64721-07 for ; Mon, 12 Jul 2004 02:17:23 +0000 (GMT) Received: from mpls-qmqp-03.inet.qwest.net (mpls-qmqp-03.inet.qwest.net [63.231.195.114]) by svr1.postgresql.org (Postfix) with SMTP id 4E01AD1B376 for ; Sun, 11 Jul 2004 23:17:16 -0300 (ADT) Received: (qmail 6365 invoked by uid 0); 12 Jul 2004 01:47:17 -0000 Received: from mpls-pop-11.inet.qwest.net (63.231.195.11) by mpls-qmqp-03.inet.qwest.net with QMQP; 12 Jul 2004 01:47:17 -0000 Received: from 63-227-127-37.dnvr.qwest.net (HELO ?10.0.0.2?) (63.227.127.37) by mpls-pop-11.inet.qwest.net with SMTP; 12 Jul 2004 02:17:20 -0000 Date: Sun, 11 Jul 2004 20:18:25 -0600 Message-Id: <1089598705.17991.24.camel@localhost.localdomain> From: "Scott Marlowe" To: "Elijah O. Alcantara" Cc: pgsql-php@postgresql.org Subject: Re: wouldn't insert In-Reply-To: <1089596732.11624.3.camel@Falcon> References: <1089340768.18180.9.camel@Falcon> <1089596732.11624.3.camel@Falcon> Content-Type: text/plain Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.6 (1.4.6-2) Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.1 tagged_above=0.0 required=5.0 tests=RCVD_IN_SORBS X-Spam-Level: X-Archive-Number: 200407/16 X-Sequence-Number: 2841 This subject came up tangentially in the -hackers list. You should look at using the following functions: http://www.php.net/manual/en/function.pg-result-error.php http://www.php.net/manual/en/function.pg-result-status.php supported since 4.2.0 came out a little over two years ago. Very nice way to catch and handle errors. On Sun, 2004-07-11 at 19:45, Elijah O. Alcantara wrote: > I tried using error_log() but never got any emails... > > error_log("This is query2 inserting $ctrl_no $category $contact_no > $organization_name $address $telephone $fax $email", 1, > "elijah@asti.dost.gov.ph"); > > looks like it never went in the for loop, somethings wrong... > > Thanks for the advice, > Elijah > > On Sat, 2004-07-10 at 03:08, brew@theMode.com wrote: > > Elijah..... > > > > > There are no errors whatsoever, must be something wrong with the logic > > > somewhere... > > > > What I do when I can't find errors is break down the code into > > smaller steps and add error checking. > > > > Make the connection and check the return value. > > > > Put together the sql statement and print it. > > > > Query the database and check the return value. > > > > and so forth..... > > > > Check php.net to see some examples of error checking. > > > > On another note, if I'm only working with only one db I just connect once > > near the start of the script and then use that connection for the > > subsequent calls. > > > > brew > > > > ========================================================================== > > Strange Brew (brew@theMode.com) > > Check out my Musician's Online Database Exchange (The MODE Pages) > > http://www.TheMode.com > > ========================================================================== > > > > > > ---------------------------(end of broadcast)--------------------------- > > TIP 9: the planner will ignore your desire to choose an index scan if your > > joining column's datatypes do not match > > > ---------------------------(end of broadcast)--------------------------- > TIP 5: Have you checked our extensive FAQ? > > http://www.postgresql.org/docs/faqs/FAQ.html >