prepare() only works on one statement at a time, so if you have more than one query you need to prepare() each individually.
However, using a loop can save you some code repetition...
foreach my $sql ( $SQL1, $SQL2 ) { my $sth = $dbh->prepare($sql) or die $dbh->errstr; $sth->execute; }
--k.
In reply to Re: Insering into 2 tables?
by Kanji
in thread Insering into 2 tables?
by r_mehmed
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |