pg.ddx.io  pgsql-php@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Justin Clift <justin@postgresql.org>
To: Zhidian Du <zdu@cs.nmsu.edu>
Cc: pgsql-php@postgresql.org <pgsql-php@postgresql.org>
Subject: Re: transactions?
Date: Thu, 05 Sep 2002 17:11:29 +1000
Message-ID: <3D7703A1.867530FD@postgresql.org> (raw)
References: <3D76EE13.9A1B6676@cs.nmsu.edu>

Hi Zhidian,

How far have you gotten?

For example, have you used databases with PHP before?  PostgreSQL has a
group of functions in PHP, and generally the first one you use is the
pg_pconnect() function, with some parameters to tell it how to connect,
where to, etc.

Then you can do stuff like execute queries against a database you've
already prepared, and so forth.

When actually inserting user data, if you need to keep it "as is" but
you'd like to be able to display it back at some point, I reckon you'll
be interested in the rawurlencode() and rawurldecode() functions. 
Generally when I code stuff the very first thing that happens is that
all external input is made "safe" with rawurlencode() and that's how it
gets used internally from there on, that's how it gets stored, etc.  The
only time it gets rawurldecode()'d is as part of an echo string back to
the outside world.

Does that help?

:-)

Regards and best wishes,

Justin Clift


Zhidian Du wrote:
> 
> I am writing a B/S program.  I want to save all the users' inputs, for
> example, "insert into TABLE value (.....);"  in the server side, how can
> I implement in PHP?
> 
> also,  how can I use transactions to rollback and commit in PHP?
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org

-- 
"My grandfather once told me that there are two kinds of people: those
who work and those who take the credit. He told me to try to be in the
first group; there was less competition there."
   - Indira Gandhi



view thread (3+ messages)  latest in thread

Message-ID: <3D7703A1.867530FD@postgresql.org>
Permalink:  ../3D7703A1.867530FD@postgresql.org/
Also on:    postgresql.org/message-id/3D7703A1.867530FD@postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-php@postgresql.org
  Cc: justin@postgresql.org, zdu@cs.nmsu.edu
  Subject: Re: transactions?
  In-Reply-To: <3D7703A1.867530FD@postgresql.org>
  References: <3D76EE13.9A1B6676@cs.nmsu.edu> <3D7703A1.867530FD@postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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