http://www.perlmonks.org?node_id=229421


in reply to Insering into 2 tables?

If you put both statements in a single string, seperated by a semi-colon this should work. I am not saying this is a good way of doing it, but for informations sake:
my $SQL1 = "INSERT INTO property (address_1, address_2, county, cit +y, zip, description, status, bedroom) VALUES ('$address_1', '$address +_2', '$county', '$city', '$zip', '$description', '$status', '$bedroom +'); INSERT INTO property2 (address_1, address_2, county, city, zip, d +escription, status, bedroom) VALUES ('$address_1', '$address_2', '$co +unty', '$city', '$zip', '$description', '$status', '$bedroom')"; my $sth= $dbh->prepare($SQL1) or die $dbh->errstr;