Re: [PHP-DB] pg_result_error()

From: Martin Marques <martin(at)bugs(dot)unl(dot)edu(dot)ar>
To: Gerard Samuel <php-db(at)trini0(dot)org>, php-db(at)lists(dot)php(dot)net
Cc: pgsql-php(at)postgresql(dot)org
Subject: Re: [PHP-DB] pg_result_error()
Date: 2003-12-12 15:24:57
Message-ID: 200312121224.57200.martin@bugs.unl.edu.ar
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-php

El Vie 12 Dic 2003 11:19, Gerard Samuel escribió:
> 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ó:
> > > What good is this function?
> > > A quick example of the wall Im running into ->
> > > $sql = 'INSERT INTO .....';
> > > $result = pg_query($conn_id, $sql);
> > > if ($result === 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
why this is like this?

P.D.: I had to pass my php4 in Debian to unstable to get a workable (with the
newer capabilities) version. Very annoing, especially becuase I had to pass
apache to unstable as well. :-(

--
12:13:01 up 16 days, 18:29, 3 users, load average: 1.32, 0.90, 0.67
-----------------------------------------------------------------
Martín Marqués | select 'mmarques' || '@' || 'unl.edu.ar'
Centro de Telematica | DBA, Programador, Administrador
Universidad Nacional
del Litoral
-----------------------------------------------------------------

In response to

Responses

Browse pgsql-php by date

  From Date Subject
Next Message Nathaniel Price 2003-12-12 18:37:27 Reordering results for a report
Previous Message Gerard Samuel 2003-12-12 14:19:36 Re: [PHP-DB] pg_result_error()