Hi, there:
I try to write a perl code that takes form data from
html page and inserts or updates database tables. I
have successfully insert data into one table, but fail
to insert data into another table. My sample as
follows:
***************************************************
my $dbh = DBI->connect('dbi:mysql:ordering','yxc',
'9cvpt')
||die "unable to connect: $DBI::errstr";
my $sql = "INSERT INTO order_record (reqID, my $sth = $dbh->prepare($sql) $sth->execute(); my $dbh2 = DBI->connect('dbi:mysql:ordering','yxc', I have tried to use one connection to execute two sql Anyone has the idea. Thanks yc __________________________________________________
product_name,catalog_No,supplier,order_date,status,who_ordered,PO_Num,local
item_type, description, unit_price, unit_size,
num_of_unit, measure_type) VALUES
('','$product_name','$catalog_no','$supplier','$order_date',
'$status','$username','$PO_Num','$local_Req_No','$item_type','$req_note','$
||die "unable to prepare $sql: $DBI::errstr";
$sth->finish();
$dbh->disconnect();
'9cvpt')
||die "unable to connect: $DBI::errstr";
my $sql2 = "INSERT INTO company-profile (company_name,
contact_name,address,city,postal_code,phone,fax,e-mail,website)
VALUES
('$supplier','','$address','','','$tel_num','$fax_num','$email','')";
my $sth2 = $dbh->prepare($sql2)
||die "unable to prepare $sql: $DBI::errstr";
$sth2->execute();
$sth2->finish();
$dbh2->disconnect();
******************************************************
statement, it didn't work also. So, I seperated two
process, it still doesn't work.
Do You Yahoo!?
Yahoo! - Official partner of 2002 FIFA World Cup
http://fifaworldcup.yahoo.com