Beefy Boxes and Bandwidth Generously Provided by pair Networks RobOMonk
Do you know where your variables are?
 
PerlMonks  

Re: Single mysql query

by jaldhar (Vicar)
on May 31, 2008 at 06:08 UTC ( #689395=note: print w/ replies, xml ) Need Help??


in reply to Single mysql query

DBI has a number of functions that let you bypass having to code a loop. (Behind the scenes they are looping so these are just shortcuts really.)

if you know you're only going to get one row back, selectrow_array (or _arrayref or _hashref) does the prepare, execute, and fetch all in one go for you.

If you want an arrayref of arrayrefs or hashrefs (each representing one row,) the selectall_arrayref or selectall_hashref functions combine prepare, execute, and fetch into one function for you.

If you only want certain columns from each row returned as an array of arrayrefs (each representing the selected columns in one row, selectcol_arrayref does the prepare, execute, and fetch in one go just like the other functions.

--
જલધર


Comment on Re: Single mysql query

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (4)
As of 2014-04-19 02:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (475 votes), past polls