Re: PgSQL error codes in PHP

From: Markus Bertheau <twanger(at)bluetwanger(dot)de>
To: Dawid Ferenczy <ferenczy(at)volny(dot)cz>
Cc: pgsql-php(at)postgresql(dot)org
Subject: Re: PgSQL error codes in PHP
Date: 2004-11-13 13:41:25
Message-ID: 1100353285.3304.2.camel@fc3
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-php

Here's a patch for getting the sqlstate for PHP5. It should apply to
PHP4 without problems:

http://marc.theaimsgroup.com/?l=php-dev&m=109991803204873&w=2

В Птн, 12/11/2004 в 14:01 +0100, Dawid Ferenczy пишет:
> Hi,
>
> I need help, please - I tried Google, some specialized mailinglist
> and I got no result for a week. I would like to determine PgSQL error
> codes in PHP after executing a query, but I found functions for getting
> error messages only which I found not usable (messages are often
> localised and so on). On PHP manual pages is for that reason some patch,
> but only for PHP 4.x and with broken link ;) I need solution in PHP 5.
>
> For example:
>
> 'CREATE TABLE xxx;'
>
> If table already exists, PgSQL return error message "Relation xxx
> already exists" or "Relace xxx jiz existuje" in czech language and (not
> in UTF-8 coding ;)
>
> So now, I know that some error occurs but I cannot determine cause :(
> (compare error messages is nonsense).
>
> If I'll not find relevant solution, I'm going to write this function
> in PgSQL extension (oh my God!!! [I'm atheist ;) ])
>
> Sorry for my english, it isn't my strong side, if you want I'll
> welcome some language corrections ;)
>
> Thanx a lot, you are my last chance before I'll go to write my own
> implementation...
>
--
Markus Bertheau <twanger(at)bluetwanger(dot)de>

In response to

Browse pgsql-php by date

  From Date Subject
Next Message Muhyiddin A.M Hayat 2004-11-17 07:06:40 plPHP on Windows
Previous Message Thom Dyson 2004-11-12 16:00:08 Re: PgSQL error codes in PHP