in reply to how do i store the result from query into hash
my $sth = $dbh->prepare("SELECT item, quantity FROM inventor") or die +DBI->errstr; $sth->execute() or die DBI->errstr; my %hash; while( my( $item, $quantity ) = $sth->fetchrow_array() ) { $hash{ $item } = $quantity; } # do whatever you'd like with hash.
|
|---|