Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re^3: Retrieving multiple records from database

by jZed (Prior)
on Oct 16, 2004 at 19:07 UTC ( [id://399797]=note: print w/replies, xml ) Need Help??


in reply to Re^2: Retrieving multiple records from database
in thread Retrieving multiple records from database

My next question is why does fetchrow_array() only return an array of 1 element, but fetchall_arrayref({}) nabs them all?

Well the difference between fetch*row* and fetch*all* explains why fetchrow gets just one row and fetchall gets them all. The difference between fetchrow_*array* and fetchrow_*arrayref* explains why using a scalar returns 1 value for an array and all values into an arrayref. If you want the full row, you need to do @row = fetchrow_array(), not $row = fetchrow_array().

  • Comment on Re^3: Retrieving multiple records from database

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (1)
As of 2024-04-25 00:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found