Re: PHP + PostgreSQL

From: "PG Explorer" <pgmail(at)pgexplorer(dot)com>
To: "Dmitri Touretsky" <dmitri(at)listsoft(dot)ru>, <pgsql-novice(at)postgresql(dot)org>
Subject: Re: PHP + PostgreSQL
Date: 2002-02-28 05:40:40
Message-ID: 001401c1c01a$791e5c00$c80ba8c0@sabex.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

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(at)listsoft(dot)ru>
To: <pgsql-novice(at)postgresql(dot)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(at)listsoft(dot)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

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message denis 2002-02-28 08:39:35 ElseIF in PLPGSQL
Previous Message Damon Fasching 2002-02-28 02:30:41 How does one determine which columns are constrained PRIMARY KEY?