Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw

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 lurking in the Monastery: (3)
As of 2018-07-21 03:36 GMT
Find Nodes?
    Voting Booth?
    It has been suggested to rename Perl 6 in order to boost its marketing potential. Which name would you prefer?

    Results (444 votes). Check out past polls.