Check out the 'You may often want to fetch an array of rows where each row is stored as a hash' section of the DBI documentation.my $dbh = database->connect_mysql(); my $sql = "select * FROM mytable WHERE date < DATE_ADD(NOW(), INTERVAL -30 DAY)"; my $records = $dbh->selectall_arrayref( $sql, { Slice => {} } ); foreach my $record ( @$records ) { my $user = $record->{user}; my $id = $record->{id}; print "Data Test: $user - $id<br>"; }
In reply to Re^3: Not an ARRAY reference Error Help!
by derby
in thread Not an ARRAY reference Error Help!
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |