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
-- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php