Help for this page

Select Code to Download


  1. or download this
    my $sth = $dbh->prepare("insert into t (foo,bar) values (?,?)");
    $sth->execute("foo", 1);
    $sth->execute("bar", 2);
    $sth->execute("baz", 3);
    
  2. or download this
    while (my $record = $sth->fetchrow_hashref) {
    
    ...
    
      push @records, $record;
    }