Re: MySQL Transaction
| From: | John W. Holmes | Date: | Wed, 18 Jun 2003 01:34:20 +0000 |
| Subject: | Re: MySQL Transaction | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-28697@lists.php.net to get a copy of this message | ||
Becoming Digital wrote:
A question was raised on the MySQL list about implementing transactions with PHP. I had planned on them for an upcoming project but I'd yet to figure out how I'd coordinate things. The original author's solution (slightly altered) was to make an array with all the queries and loop through them, setting a boolean flag and exiting the loop if a query fails. Testing for the value of the flag would execute a commit or rollback according to its value.Sounds like a good solution to me. Sounds like something that could easily be passed to a function with a flag to use a transaction or not on the group of queries. Sounds good. -- ---John Holmes... Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/ PHP|Architect: A magazine for PHP Professionals – www.phparch.com