Help for this page

Select Code to Download


  1. or download this
    my $col="insert into table mytable (";
    my $val="values (";
    ...
    $statement="$col) $val)";
    $sth=$dbh->prepare($statement);
    $sth->execute(@arr);
    
  2. or download this
    my $sth=$dbh->prepare("insert into table mytable (name,value) values (
    +?,?)");
    foreach (param()) {
      $sth->execute($_,param($_)); # will only insert the first value if a
    + variable has multiple values
    }