Hi!
Is this correct for transactions?
---------------------------------
my $sth = $dbh->prepare("INSERT INTO global VALUES('12','no','0.00')");
my $sth2 = $dbh->prepare("INSERT INTO global2 VALUES('12','no','0.00')");
eval {
$sth->execute();
$sth2->execute();
$dbh->commit();
}
if( $@ ) {
#log this error or email the admin
$dbh->rollback();
}
$sth->finish();
---------------------------------------
Is this correct for transactions?
---------------------------------
my $sth = $dbh->prepare("INSERT INTO global VALUES('12','no','0.00')");
my $sth2 = $dbh->prepare("INSERT INTO global2 VALUES('12','no','0.00')");
eval {
$sth->execute();
$sth2->execute();
$dbh->commit();
}
if( $@ ) {
#log this error or email the admin
$dbh->rollback();
}
$sth->finish();
---------------------------------------