Help for this page

Select Code to Download


  1. or download this
    # prepare the sql once
    my $sth = $dbh->prepare(q/select column1 from mytable where column2 = 
    +?/);
    ...
       $sth->execute($my_key_into_table);
       my ($column1) = $sth->fetchrow;  
    }
    
  2. or download this
    my $hashref = $dbh->selectall_hashref(q/select column1,key_column from
    + mytable/, 'key_column');