develooper Front page | perl.beginners | Postings from September 2009

How to fill an array from multiple row in a db

Thread Next
From:
Bruce Ferrell
Date:
September 30, 2009 10:18
Subject:
How to fill an array from multiple row in a db
Message ID:
4AC391BF.2060406@baywinds.org

I have a database (mysql if it matters) and I can select columns and
rows from it no problem.  what I can't quite seem to see how to do is to
take the columns I can select and put them into a 2 dimensional array.

I tried this:

@data = $sth->fetchrow_array();

and it got a two dimensional array of one element each and this:

@rtn = $sth->fetchrow_array();
push(@data,@rtn) seems to get me a giant 1 dimensional array.

I'm sort of at a loss

TIA

Bruce

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About