Re: PATCH: DB::ifx.php
| From: | Tomas V.V.Cox | Date: | Mon, 30 Jun 2003 09:46:04 +0000 |
| Subject: | Re: PATCH: DB::ifx.php | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-17854@lists.php.net to get a copy of this message | ||
Hi James,
I've commited your patch. Will be shipped with next DB release. Thanks!
Tomas V.V.Cox
On Friday, June 27, 2003 4:36, James Kaufman wrote:
> Attached is a patch for ifx.php for PEAR's DB package. The patch adds
> transaction capability in much the same way that it exists for mysql. The
> commit flag defaults to true, but if the programmer wants to start a
> transaction, s/he can set the commit flag to false, and all further queries
> that change the database will be part of the transaction. Here is the basic
> usage:
$dbh->>autoCommit(false); // start the transaction
$res=$dbh->>query('update database...');
> if (!$res) {
> $dbh->rollback();
> die...
> }
$res=$dbh->>query('update more...);
> if (!$res) {
> $dbh->rollback();
> die...
> }
$dbh->>commit(); // commit the transaction
> --
> Jim Kaufman mailto:jmk@linuxforbusiness.net
> Linux Evangelist cell: 612-481-9778
> public key 0x6D802619 fax: 952-937-9832
> http://www.linuxforbusiness.net
--
Tomas V.V.Cox mailto:cox@idecnet.com