in reply to Use DBI to select and return multiple database entries
You have forgotten to execute your statement. After you prepare, you must $sth->execute your statement before $sth->fetching results. As you haven't executed your statement, it contains no results.
Alternatively, try fiddling with $dbh->selectall_arrayref or $dbh->selectall_hashref, which does the preparing, executing and fetching for you in one go.
Alternatively, try fiddling with $dbh->selectall_arrayref or $dbh->selectall_hashref, which does the preparing, executing and fetching for you in one go.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Use DBI to select and return multiple database entries
by jayto (Acolyte) on Jul 17, 2012 at 18:36 UTC |
In Section
Seekers of Perl Wisdom