Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: Use DBI to select and return multiple database entries

by Neighbour (Friar)
on Jul 17, 2012 at 06:40 UTC ( #982149=note: print w/ replies, xml ) Need Help??


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.


Comment on Re: Use DBI to select and return multiple database entries
Select or Download Code
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
    Thanks that's what I ended up doing and it worked.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://982149]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (5)
As of 2015-08-04 04:17 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The oldest computer book still on my shelves (or on my digital media) is ...













    Results (59 votes), past polls