The commit line will never get called unless the execute went ok. Your program rolls back the query if the eval died. If you are worried about rollback not working, it should also be wrapped in another eval.eval { my $sth=$dbh->prepare( q{ your sql here } ); $sth->execute( ... ); # params in the parens to be inserted as above $dbh->commit; }; if($@) { $dbh->rollback; print STDERR "Bad things happened: $@"; }
In reply to Re: Re: CGI and DBI, new to me...
by dga
in thread CGI and DBI, new to me...
by mojobozo
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |