pg.ddx.io pgsql-php@postgresql.org mailing list archive
help / color / mirror / Atom feedPgSQL error codes in PHP
3+ messages / 3 participants
[nested] [flat]
* PgSQL error codes in PHP
@ 2004-11-12 13:01 Dawid Ferenczy <ferenczy@volny.cz>
0 siblings, 2 replies; 3+ messages in thread
From: Dawid Ferenczy @ 2004-11-12 13:01 UTC (permalink / raw)
To: pgsql-php
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...
--
Dawid Ferenczy
http://xcoder.jinak.cz
ICQ: 85997864
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: PgSQL error codes in PHP
@ 2004-11-12 16:00 Thom Dyson <TDyson@sybex.com>
parent: Dawid Ferenczy <ferenczy@volny.cz>
1 sibling, 0 replies; 3+ messages in thread
From: Thom Dyson @ 2004-11-12 16:00 UTC (permalink / raw)
To: pgsql-php
Dawid,
I think you will have to build something. If I understand the problem
correctly, PHP's error routine needs the connection handle to get the
error, but there is no connection handle if there is an error (!), so PHP
can't read an error number.
I have seen other people looking for answers to this, but I have never
seen any answers.
Thom Dyson
Director of Information Services
Sybex, Inc.
pgsql-php-owner@postgresql.org wrote on 11/12/2004 05:01:11 AM:
> 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).
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: PgSQL error codes in PHP
@ 2004-11-13 13:41 Markus Bertheau <twanger@bluetwanger.de>
parent: Dawid Ferenczy <ferenczy@volny.cz>
1 sibling, 0 replies; 3+ messages in thread
From: Markus Bertheau @ 2004-11-13 13:41 UTC (permalink / raw)
To: Dawid Ferenczy <ferenczy@volny.cz>; +Cc: 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@bluetwanger.de>
^ permalink raw reply [nested|flat] 3+ messages in thread
end of thread, other threads:[~2004-11-13 13:41 UTC | newest]
Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2004-11-12 13:01 PgSQL error codes in PHP Dawid Ferenczy <ferenczy@volny.cz>
2004-11-12 16:00 ` Thom Dyson <TDyson@sybex.com>
2004-11-13 13:41 ` Markus Bertheau <twanger@bluetwanger.de>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox