Bruce Ferrell wrote:
>
[snip]
>
> OK if I read these right and I understand the results of
> my experiments
> correctly, this:
>
> @rtn = $sth->fetchrow_array();
>
> is giving me an array with two elements and this:
>
> push @data, [ @rtn ];
>
> is giving me an array of 2 element arrays.  Not good as
> what I want is 2
> arrays each the length of the total rows returned.  What
> it seems I need
> to do is something like this:
>
> my ( $current_level, $time ) = $sth->fetchrow_array();
>
> push @data[0][#]->$current_level;
> push @data[1][#]->$time;
>
> ... repeat until out of rows
>
> Is that correct notation to add the variable to the end of
> the array(s)?
>
>
Why not use fetchall_arrayref instead of fetchrow_array?

http://search.cpan.org/~timb/DBI-1.609/DBI.pm#fetchall_arrayref




-- 
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
http://learn.perl.org/


Reply via email to