in reply to Logic problem on loops
with calls that use selectall_arrayref. Use bind so you can write:while (@dataf = $sthf->fetchrow_array()) { $filiais[$xf] = $dataf[0]; $xf++; }
Use placeholders to save issues with quoting:$sth->execute; $sth->bind_columns(\my $x, \my $y); while ($sth->fetch) { # use $x and #y }
You've also got quite a bit of code that looks repeated. Maybe you can refactor it out into some loops or subroutine calls. You should try to make functions shorter in length so that it's easier to comprehend and you don't have to keep scrolling up and down so much.my $sth = $dbh->prepare('select w from x where y = ? and z = ?'); $sth->execute($y, $z);
That's all for now...
gav^
|
|---|