Help for this page

Select Code to Download


  1. or download this
    my %hash;
    my %rec;
    ...
    while ($sth->fetch) {
        $hash{$rec{week}} = [ $rec{month}, $rec{workperiod} ];
        }
    
  2. or download this
    my %hash;
    my $sth = $db->prepare ("select week, month, workperiod from tablename
    +");
    ...
    while ($sth->fetch) {
        $hash{$week} = [ $month, $workperiod ];
        }
    
  3. or download this
    my $dbh = DBI->connect ("dbi:$driver:", "user", "pass", { FetchHashKey
    +Name => "NAME_lc" });
    my %hash;
    ...
    while (my $rec = $sth->fetchrow_hashref) {
        $hash{$rec->{week}} = [ $rec->{month}, $rec->{workperiod} ];
        }