Code:
$sqlquery= "SELECT Email FROM Members"; $sth = $dbh->prepare($sqlquery);
$sth->execute;
my $records = $sth->fetchall_arrayref({});
$sth->finish();
for my $record (@$records) {
# fieldvalue = $record->{'fieldname'}
}
Or you can define your variables before hand:
Code:
while ($pointer = $sth->fetchrow_hashref) { $field_value = $pointer->{'field_name'};
print "blah blah $field_value blah";
}
Read the documentation on the use of fetchall_arrayref({});, though. You'll find that fetchrow_arrayref is a faster way to fetch your data.
Wil