Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re^4: fetchrow_array

by injunjoel (Priest)
on May 27, 2005 at 18:26 UTC ( #461188=note: print w/ replies, xml ) Need Help??


in reply to Re^3: fetchrow_array
in thread fetchrow_array

Greetings all,
Here is my crack at it.
we know that

$sth->{NAME_lc};
returns the column names selected and lower-cased. with that we then utilized those names as a hash slice from the hash %row with the
@row{ @{$sth->{NAME_lc}}};
part. So up to this point we have a hash %row with keys equal to the lower-cased column names returned from the query. So next we reference the slice for the bind_columns call, which we accomplish by doing an \ on the entire list; the same as saying
$sth->bind_columns(\($var1, $var2, $var3));
which would create references for each var in the list.
Nice way of doing it and probably one I will adopt in the future since I mostly use either fetchrow_hashref or just bind explicit vars.
Does that make sense?

-InjunJoel
"I do not feel obliged to believe that the same God who endowed us with sense, reason and intellect has intended us to forego their use." -Galileo


Comment on Re^4: fetchrow_array
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (9)
As of 2015-07-04 20:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (60 votes), past polls