Transactions in Drupal 6
Transactions are done with SQL and in Drupal 6 you need to write all your SQL. So to use transactions, all you need to do, is to use db_query(SQL) and include transaction in the SQL you create.

This could look like this:

$sql = 'START TRANSACTION;
       SELECT @A:=SUM(salary) FROM table1 WHERE type=1;
       UPDATE table2 SET summary=@A WHERE type=1;
       COMMIT;';
db_query($sql);


Remember to use an engine that supports transactions like innodb.