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.
In reply to Re: how do i store the result from query into hash
by Masem
in thread how do i store the result from query into hash
by anjaana78
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |