X-Original-To: pgsql-php-postgresql.org@localhost.postgresql.org Received: from localhost (neptune.hub.org [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 18797D1DFFC for ; Fri, 12 Dec 2003 15:26:15 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 39902-02 for ; Fri, 12 Dec 2003 11:25:47 -0400 (AST) Received: from bugs.unl.edu.ar (bugs.unl.edu.ar [168.96.132.208]) by svr1.postgresql.org (Postfix) with ESMTP id 1133DD1E06B for ; Fri, 12 Dec 2003 11:25:23 -0400 (AST) Received: from localhost (localhost [127.0.0.1]) by bugs.unl.edu.ar (Postfix) with ESMTP id 99C6512460; Fri, 12 Dec 2003 12:25:00 -0300 (ART) Received: from bugs.unl.edu.ar ([127.0.0.1]) by localhost (bugs [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 18657-01; Fri, 12 Dec 2003 12:24:59 -0300 (ART) Received: from localhost (localhost [127.0.0.1]) by bugs.unl.edu.ar (Postfix) with ESMTP id 2505211DDA; Fri, 12 Dec 2003 12:24:59 -0300 (ART) From: Martin Marques To: Gerard Samuel , php-db@lists.php.net Subject: Re: [PHP-DB] pg_result_error() Date: Fri, 12 Dec 2003 12:24:57 -0300 User-Agent: KMail/1.5.4 Cc: pgsql-php@postgresql.org References: <200312112209.54516.php-db@trini0.org> <200312120844.16882.martin@bugs.unl.edu.ar> <200312120908.18042.php-db@trini0.org> In-Reply-To: <200312120908.18042.php-db@trini0.org> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Message-Id: <200312121224.57200.martin@bugs.unl.edu.ar> X-Virus-Scanned: by amavisd-new-20030616-p5 (Debian) at unl.edu.ar X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200312/21 X-Sequence-Number: 2467 El Vie 12 Dic 2003 11:19, Gerard Samuel escribi=F3: > Im going to CC this to the PostgreSQL list also. > > On Friday 12 December 2003 06:44 am, Martin Marques wrote: > > El Vie 12 Dic 2003 00:09, Gerard Samuel escribi=F3: > > > What good is this function? > > > A quick example of the wall Im running into -> > > > $sql =3D 'INSERT INTO .....'; > > > $result =3D pg_query($conn_id, $sql); > > > if ($result =3D=3D=3D false) > > > { > > > var_dump( pg_result_error( $result ) ); > > > > I would use here this: > > die(pg_result_error( $result )); > > That is fine and all, but my original example was just an example of the > non functionality of pg_result_error(), not how to handle errors when a > query fails. > But for arguement sake, lets use your example in some dummy code[0]. > $result is still boolean false, and pg_result_error() will still return an > empty string, and using die, would just die, with no report of what > happened. Then whats the use of pg_result_error(). Looks like you are totally right. Tried it and it works horrible. Any idea = on=20 why this is like this? P.D.: I had to pass my php4 in Debian to unstable to get a workable (with t= he=20 newer capabilities) version. Very annoing, especially becuase I had to pass= =20 apache to unstable as well. :-( -- 12:13:01 up 16 days, 18:29, 3 users, load average: 1.32, 0.90, 0.67 ----------------------------------------------------------------- Mart=EDn Marqu=E9s | select 'mmarques' || '@' || 'unl.edu.ar' Centro de Telematica | DBA, Programador, Administrador Universidad Nacional del Litoral -----------------------------------------------------------------