How insert data with Perl into multiple MySQL tables?

I can not find any clear advice..


this is for TABLE1:

# Connect to the database.
my $dbh = DBI->connect("DBI:mysql:database=xxxx;host=localhost",
                       "username", "pass",
                       {'RaiseError' => 1});


# now first make that sql statement the right way - use placeholders

my $sql = "INSERT INTO TABLE1 (xxx1, xxx2, xxx3) VALUES (?,?,?)"; 


#now prepare it
my $sth = $dbh->prepare($sql);


# now simply execute it

$sth->execute($f->{xxx1},$f->{xxx2},$f->{xxx3});


$sth->finish();

$dbh->disconnect();



How insert into TABLE1 and TABLE2 at same time?

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to