Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"

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?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://206758]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (2)
As of 2018-04-27 01:29 GMT
Find Nodes?
    Voting Booth?