Fatal error: Call to undefined function db_transaction() I am new to drupal. In an attempt to achieve transaction, I get this fatal error. I am using drupal 6.22 and MySQL. db_query() and all the other database related functions are working fine, but db_transaction() alone fails. What am I doing wrong here? Any help is appreciated. 

$transaction = db_transaction();

try {
       $result = db_query($query);
}
catch (Exception $e) {
       $transaction-&gt;rollback();

}
There is no fuction db_transaction() for Drupal 6 (see Drupal 6 API search).

It is available for Drupal 7 though: db_transaction()