Re: transactions?
От | Harry Waddell |
---|---|
Тема | Re: transactions? |
Дата | |
Msg-id | 20020905004304.4da1c968.waddell@caravan.com обсуждение исходный текст |
Ответ на | Re: transactions? (Justin Clift <justin@postgresql.org>) |
Список | pgsql-php |
> > 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? > > I use these functions to start, stop and abort transactions. [although most people would find it silly to wrap a single line of code with another function. I have my reasons.] Function begin_work($pg){ pg_FreeResult(pg_Exec($pg, "begin work")); return(TRUE); } Function end_work($pg){ pg_FreeResult(pg_Exec($pg, "end work")); return(TRUE); } Function abort_work($pg){ pg_FreeResult(pg_Exec($pg, "abort")); return(TRUE); } where $pg is the database handle from pg_[p]connect(). -- Harry Waddell Caravan Electronic Publishing
В списке pgsql-php по дате отправления: