Re: DB and transactions? PLEASE HELP!
| From: | Bob Bell | Date: | Mon, 09 Jun 2003 12:18:03 +0000 |
| Subject: | Re: DB and transactions? PLEASE HELP! | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-5858@lists.php.net to get a copy of this message | ||
On Fri, Jun 06, 2003 at 10:05:44PM -0700, user@domain.invalid <user@domain.invalid> wrote:
> on a deadline and i decided to start using the PEAR DB lib to find out i
> can figure how to do transactions.
What was told to me when I asked:
// begin transaction
$db->autoCommit(false);
$result = $db->query("update a set b='c'");
if (DB::isError($result)) {$db->rollback(); die ($result->getMessage());}
// end transaction
$db->commit();
--
Bob Bell <bbell@hp.com>
-------------------------------------------------------------------------
"Whatever I want, I get... That's the beauty of being worth $26
billion. I thoroughly recommend it."
-- Larry Ellison, Oracle CEO