If your database supports it you can call:
odbc_exec($conn, "ROLLBACK");
Or, IIRC, for MS SQL it would be
odbc_exec($conn, "ROLLBACK TRAN");
Of course if you have implicit transactions this won't work. For MS SQL you'd first have to do a BEGIN TRAN, then either COMMIT TRAN or ROLLBACK TRAN.
If that's not the answer let us know what database you're using.