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

pakeidoprek has asked for the wisdom of the Perl Monks concerning the following question:

Get Parameter By Form & then insert into tbl

if ( param('Submit') ) { # get data from parameter to database my @params = param(); my $full_name = param ('full_name'); my $pob = param ('pob'); my $dob = param ('dob'); my $gender = param ('gender'); my $address = param ('address'); my $email = param ('email'); my $phone = param ('phone'); my $username = param ('username'); my $password = param ('password'); my $high_school = param ('high_school'); my $school_dep = param ('school_dep'); my $year_in = param ('years'); # data to tbl:students # ---------------------------------------------------------------- my $students = $dsn->prepare("INSERT INTO students (username, password) values (?,?) "); $students->execute($username,$password) or die $DBI::errstr; $students->finish(); # data to tbl:students_bio # ---------------------------------------------------------------- my $students_bio = $dsn->prepare("INSERT INTO students_bio ( username, full_name, pob, dob, gender, addr, email, phone, high_school, school_dep, years ) values (?,?,?,?,?,?,?,?,?,?,?) "); $students_bio->execute($username,$full_name,$pob,$dob, $gender,$address,$email,$phone, $high_school,$school_dep,$year_in) or die $DBI::errstr; $students_bio->finish(); # data to tbl:students_parent # ---------------------------------------------------------------- my $students_parent = $dsn->prepare("INSERT INTO students_parent (username) values (?) "); $students_parent->execute($username) or die $DBI::errstr; $students_parent->finish(); };

I don't have problem to insert data to 1 tables with this method. but when i used this methods to insert data to multiple or more tables, the data just insert into 1st table and no activity with the 2nd $ 3rd table

I'm so sorry if my english so bad. Thank's for the attention, Cheers for u, i'm from indonesia.