// --- insert a new record with transaction processing -----------
$sql = "INSERT INTO Test (Color, Age) Values ('Blue', 3)";
$db->TransactionBegin();
if ($db->Query($sql)) {
$db->TransactionEnd();
echo "Last ID inserted was: " . $db->GetLastInsertID() . "
\n";
} else {
$db->TransactionRollback();
echo "
Query Failed
\n"; }