Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

O'Reilly:
Pitfalls of Transactions with PHP
Dec 19, 2003 @ 13:18:55

The O'Reilly Network has a new article this morning about one of the newest (and most anticipated) features of MySQL - transactions - and how to use them effectively while avoiding common pitfalls.

Using transactions can save time and money, because transactions enable databases to restore themselves. But inappropriate use of transactions means wasted overhead and impeded performance. And transactions do not replace programming; sadly, some developers have foregone error trapping and data validation, thinking that transactions will catch all errors.

They go on to talk about how to use them effectively, and not to use them as a crutch to make up for bad data validation in your code. They give the example of a simple web form, showing the levels of validation you should pass through *before* sending it on to the transaction, and an extensive code block to help you along more quickly...

tagged:

Link:


Trending Topics: