Help for this page

Select Code to Download


  1. or download this
      $dbh->{FetchHashKeyName} = 'NAME_lc';
      $sth = $dbh->prepare("SELECT FOO, BAR, ID, NAME, BAZ FROM TABLE");
      $sth->execute;
      $hash_ref = $sth->fetchall_hashref('id');
      print "Name for id 42 is $hash_ref->{42}->{name}\n";
    
  2. or download this
    The $key_field parameter can also be specified as an integer column nu
    +mber (counting from 1).