There is a fine line between transaction statements and error checking. I am going to blur the line a bit by using PHP to simulate a database transaction. I am doing this because the application is coded using Drupals functions and are so badly written that it will take me too much time to refactor all the functions to use db_affected_rows and return proper booleans.