Re: sql problem with php - Mailing list pgsql-php

From Robert Treat
Subject Re: sql problem with php
Date
Msg-id 200411061037.49469.xzilla@users.sourceforge.net
Whole thread Raw
In response to Re: sql problem with php  (ljb <ljb220@mindspring.com>)
List pgsql-php
On Friday 05 November 2004 20:40, ljb wrote:
> ff@dr.ufu.br wrote:
> > Hi,
> >
> >   I am having a problem with a system I developed using php with
> > postgres. ...
> >
> > I am not able to get a error_number in pgsql errors, only the error
> > message. So when I used pgsql 7.3 a used the string "referential
> > integrity violation" to detect this error, but on version 7.4 of pgsql
> > this string was replaced with "violates foreign key constraint" .
> > Anyone has a definitive solution on this or the way is to wait and change
> > all my code on future releases of pgsql?
>
> Unfortunately this is a limitation of the PHP PostgreSQL extension.
> PostgreSQL provids access to error numbers (I think as of 7.4)
> through libpq PQerrorField(), but PHP doesn't give you access to this yet.
>

Actually I believe you can get it:
http://us2.php.net/manual/en/function.pg-result-error.php

though this will only work in pg74 or greater.

--
Robert Treat
Build A Brighter Lamp :: Linux Apache {middleware} PostgreSQL

pgsql-php by date:

Previous
From: ljb
Date:
Subject: Re: sql problem with php
Next
From: ljb
Date:
Subject: Re: sql problem with php