Bruce Ferrell wrote:
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
You have to create an array of arrays.
push @data, [ @rtn ];
See:
perldoc perldsc http://perldoc.perl.org/perldsc.html
perldoc perllol http://perldoc.perl.org/perllol.html
perldoc perldata http://perldoc.perl.org/perldata.html
--
Just my 0.00000002 million dollars worth,
Shawn
Programming is as much about organization and communication
as it is about coding.
I like Perl; it's the only language where you can bless your
thingy.
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/