RE: [PHP-DB] apache/php/mysql - guarenteed DB transaction
| From: | Matt Matijevich | Date: | Wed, 04 Feb 2004 20:44:52 +0000 |
| Subject: | RE: [PHP-DB] apache/php/mysql - guarenteed DB transaction | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-32796@lists.php.net to get a copy of this message | ||
<snip>
Suppose I have several DB transactions that I want to treat as 1
logical
transaction that I need to complete guarenteed.
For instance, an INSERT to one table, and a DELETE to another, and an
UPDATE
to a third. All need to complete once a user selects submit.
What's the best approach to this scenario?
</snip>
this is the pseudo code i would use:
start the transaction
INSERT
DELETE
UPDATE
if everything is ok, commit, else rollback