Re: Error code
От | Gustavo Amarilla Santacruz |
---|---|
Тема | Re: Error code |
Дата | |
Msg-id | e4ea2d810909220617s63921795nedc17fa61b7d49f9@mail.gmail.com обсуждение исходный текст |
Ответ на | Re: Error code (Chris <dmagick@gmail.com>) |
Ответы |
Re: Error code
|
Список | pgsql-php |
Thank you, Chris.
--
Gustavo Amarilla
Now, I need to do this in PHP:
-------------------- CODE ---------------------------------------------------------------
$errorCode = pg_result_error_field($res1, PGSQL_DIAG_SQLSTATE) ;
if( $errorCode == UNIQUE_VIOLATION )
echo( "message 1" );
else if( $errorCode == DATETIME_FIELD_OVERFLOW )
echo( "message 2" );
-------------------- CODE ---------------------------------------------------------------
How I can do it?; how I can compare $errorCode with a Postgres error name ( as in http://www.postgresql.org/docs/8.1/static/errcodes-appendix.html ).
Thank you, again.
On Mon, Sep 21, 2009 at 9:00 PM, Chris <dmagick@gmail.com> wrote:
Gustavo Amarilla Santacruz wrote:http://www.php.net/manual/en/function.pg-result-error-field.phpHello all.
How I can get the postgres error code from PHP?. I can get the error text, but I need error code to verbose ( and country dependient) messages.
seems to be the best fit.
--
Postgresql & php tutorials
http://www.designmagick.com/
--
Gustavo Amarilla
В списке pgsql-php по дате отправления: