use DBI; use DBD::ODBC; my $DSN = 'perltest'; my $dbh = DBI->connect("dbi:ODBC:$DSN", '','') || die "$DBI::errstr\n"; my $sql; # there are three rows that match this select statement $sql = "SELECT * FROM contacts WHERE phone = '8675309'"; $sth = $dbh->prepare($sql); $sth->execute; # this works fine as it displays the first row of data @row = $sth->fetchrow_array; print "@row
\n"; # this does not work - displays a blank line $hashrow = $sth->fetchrow_hashref; print "$hashrow{phone}
\n"; $sth->finish(); $dbh->disconnect();