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

Re: DBI fetch array

by FamousLongAgo (Friar)
on Oct 21, 2002 at 02:54 UTC ( #206758=note: print w/replies, xml ) Need Help??


in reply to DBI fetch array

You seem to be getting one row from your result set, closing the database handle, and printing out the first value retrieved.
The while loop doesn't do anything, because you are dealing with a closed database handle. Moreover, even if you moved the disconnect statement to the end of your code, you are fetching the second element of an array ( $rowxx[1] ) that contains only one element ( $rowxx[0], e.g., the date ). Remember that array indices start at 0.
I would urge you to consider separating the display and data retrieval bits of your code, and using some kind of indentation style to make things easier to read.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (7)
As of 2018-11-17 19:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My code is most likely broken because:
















    Results (205 votes). Check out past polls.

    Notices?