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:

PHP|Architect: A magazine for PHP Professionals –

PHP Database Mailing List (
To unsubscribe, visit:

Reply via email to