$xf = 0; $sthf->execute; while (@dataf = $sthf->fetchrow_array()) { $filiais[$xf] = $dataf[0]; $xf++; } #### while (my ($col) = $sthf->fetchrow_array()) { push @filiais, $col; } #### for ($m=1; $m<=12; $m++)#Make an array of months { $months[$m] = $m; } foreach $months(@months) { #### foreach my $month (1 ... 12) {