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.


In reply to Can't Insert Data To Multiple Table With DBI::Mysql [SOLVED] by pakeidoprek

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.