> Remigiusz Sokolowski wrote:
> > Error is that You just dont END your transaction
> > before pg_Close You should have a line pg_Exec( $conn, "END;" );
> > pg_Close closes Your connection, but doesn't end Your transactions
>
> Ok! I'll give it a try ut i find that to be wierd since the code only
> enters that section that i sent before if the exec doesn't return
> anything usefull...
>
But as I remember well (I've deleted previous mails)
Your pg_Exec($conn, "BEGIN;"); call was before "if" statement -
and pg_Close( $conn ) and pg_Exec( $conn, "END;") (if You add it) inside
if - so there are two possible ways of programm flow
First one - You connect to database, open transaction and if "if"
condition is true there are executed statement inside "if" - this should
lead us to point when all is ok - and transaction and connection are
closed
if "if" condition is false then You have an open transaction and no end.
so the whole piece of code should look like:
pg_Connect
pg_Exec( $conn, "BEGIN;");
if condition {
some things, You wanna do
pg_Exec( $conn, "END;" );
} else {
pg_Exec( $conn, "ABORT;")
}
pg_Close( $conn )
I don't remember well, so I could be wrong
Rem
-------------------------------------------------------------------*------------
Remigiusz Sokolowski e-mail: rems@gdansk.sprint.pl * *
-----------------------------------------------------------------*****----------