====== startTrans ======
~~NOTOC~~
== See Also ==
[[v5:reference:connection:completetrans|completeTrans()]]\\
[[v5:reference:connection:failtrans|failTrans()]]\\
== Syntax ==
void startTrans(
optional string $monitorFn
)
===== Description =====
The function ''startTrans()'' begins a **smart transaction**.
The optional monitor function is called when a transaction fails. This monitor function can be used to control the behaviour of a transaction if it fails. The default for this function if not set is ''ADODB_TransMonitor'' which is located in the ''adodb.inc.php'' file.
-------------------------------------
===== Usage =====
/*
* Assume database connection
*/
$db->startTrans();
{{tag>["Smart Transactions"]}}