Help for this page

Select Code to Download


  1. or download this
    my $sth = $dbh->prepare_cached("SELECT foo,bar from table where id = ?
    +");
    for my $id (@ids) {
    ...
        my @results = $sth->fetchrow_array;
        $sth->finish;
    }
    
  2. or download this
    my $placeholders = join ',', ('?') x @ids;
    my $sth = $dbh->prepare_cached(
    ...
        # Put values somewhere
    }
    $sth->finish;