in reply to Getting mysql data into gd

Untested (and incomplete)

my $sth = $dbh->prepare($sql); my @data; while( @row_array = $sth->fetchrow_array ) { for my $i ( 0..3 ) { push @{ $data[$i] }, $row_array[$i]; } }