The document I read said that the second parameter is "the column to use as key, indicated by position".
What document was that? Look at the docs for fetchall_hashref, it works the same way (except you have to call prepare and execute), and has an example:
Update: I do also see this for fetchall_hashref, so you may be right (in some other version of documentation from mine), but try it both ways:$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";
Update: nevermind...see correct answer below.The $key_field parameter can also be specified as an integer column nu +mber (counting from 1).
In reply to Re: selectall_hashref
by runrig
in thread selectall_hashref
by mnlight
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |