You should create a complete query ie.
$NewQuery = "
Begin
DO SOME TRANSACTION STUFF...
COMMIT";
$tmp = pg_Exec($connection, $NewQuery);
If something goes wrong the transaction will be rolled back.
http://www.pgexplorer.com
GUI Postgres Tool
----- Original Message -----
From: "Dmitri Touretsky" <dmitri@listsoft.ru>
To: <pgsql-novice@postgresql.org>
Sent: Thursday, February 28, 2002 3:32 AM
Subject: [NOVICE] PHP + PostgreSQL
> Good time of the day!
>
> Perhaps this list is not an exact place to ask, but I haven't found an
> answer in the PHP-specific lists and boards... So I'll give a try...
>
> It's easy to work with Postgres from PHP scripts. You can access all
> you need - tuples, fields, etc. BUT I was unable to find a way to get
> a PostgreSQL reply on queries like "BEGIN" or (more important)
> "COMMIT".
>
> E.g. when I execute a query like
> $tmp = pg_Exec($connection, "SELECT * ...")
> I can get a number of returned tuples with pg_numrows($tmp), etc.
> But when I execute
> $tmp = pg_Exec($connection, "BEGIN")
> I was unable to get anything out of $tmp. And I'm pretty sure
> that PostgreSQL's reply "BEGIN" should be somwhere there...
>
> There are a number of such queries and it would be useful to be able
> to read output in order to know if things are going good or bad... Any
> ideas?
>
> Best regards,
> Dmitri ( mailto:dmitri@listsoft.ru )
>
> New SOFT daily: http://www.listsoft.ru/
> Articles, tips: http://www.diskovod.ru/
> ---
> A cat is a four footed allergen.
>
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 6: Have you searched our list archives?
>
> http://archives.postgresql.org