Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses

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.

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?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://982149]
[Corion]: marto: Yes, they were left in the dark about that :-D
[Corion]: I heard a good analogy to the GDPR, which likely only works for Germans. GDPR is the new "separating your thrash", which is common in Germany. I equate "sharing" data with littering - and likely the fight will also take 30+ years for data sharing to ...
[Corion]: ... become as socially inacceptable as littering is today
[Corion]: Has anybody worked with Template::Liquid and Template::Liquid:: Include? I must be doing something stupid because Template::Liquid:: Include won't interpolate variables in the include files for me...
[Corion]: Template::LiquidX ::Include I meant...
[Corion]: Doh - 3rd time's the charm, maybe? Tempalte::LiquidX ::Tag::Include :D
[Corion]: Ah well, you know what it should be ;) hard, copied link

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (11)
As of 2018-05-25 12:51 GMT
Find Nodes?
    Voting Booth?