Re: Error code - Mailing list pgsql-php

From Gustavo Amarilla Santacruz
Subject Re: Error code
Date
Msg-id e4ea2d810909220720i38860764sd5366878325cd4f2@mail.gmail.com
Whole thread Raw
In response to Re: Error code  (Bill Moran <wmoran@potentialtech.com>)
Responses Re: Error code
List pgsql-php
Thank you, Bill.

I can not use the numeric error code such as 23505 ( by coding convention ); I need to do this:


------------------------ CODE -----------------------------------------------------------

include( "PostgresqlErrorList.php" );
.
.
.
if( $errorCode == $UNIQUE_VIOLATION )
echo( "message" );




------------------------ CODE -----------------------------------------------------------


Here, "PostgresqlErrorList.php" is a file included in  PHP libraries. This file would can contain code such as:



<php?
    $UNIQUE_VIOLATION      = 23505;
    $DATETIME_FIELD_OVERFLOW  = 22008;
   .
   .
   .
?>


Exists this file for in Postgresql-PHP library?

On Tue, Sep 22, 2009 at 9:38 AM, Bill Moran <wmoran@potentialtech.com> wrote:
In response to Gustavo Amarilla Santacruz <gusamasan@gmail.com>:

> Thank you, Chris.
> Now, I need to do this in PHP:
>
> -------------------- CODE
> ---------------------------------------------------------------
>
> $errorCode = pg_result_error_field($res1, PGSQL_DIAG_SQLSTATE) ;
>
> if( $errorCode == UNIQUE_VIOLATION )

if ( $errorCode == '23505' )

--
Bill Moran
http://www.potentialtech.com
http://people.collaborativefusion.com/~wmoran/



--
Gustavo Amarilla
ISMEB

pgsql-php by date:

Previous
From: Bill Moran
Date:
Subject: Re: Error code
Next
From: Bill Moran
Date:
Subject: Re: Error code