Help for this page

Select Code to Download


  1. or download this
    my $query = $db->prepare("select code, username, userid from transacti
    +ons");
      $query->execute();
    
  2. or download this
      my %code = map { $_ => [] } 0 .. 13;
    
  3. or download this
      while (my $r = $qeury->fetchrow_hashref()) {
    
  4. or download this
        my $c = $$r{code};
        push @{$code{$c}}, $r;
    ...
      # contains the relevant records (as hashrefs).  The
      # number of elements in the array equals the number
      # of occurances.  Now, for the second part...
    
  5. or download this
      my %topfive;
      for my $c (keys %code) {
    ...
            [$_, $user{$_}{name}, $user{$_}{count}]
          } keys %user)[0 .. 4]];     
      }