Heya Guys and Gals -
Was wondering if the below script was the BEST way to do this -
Is there a way to get rid of $counter?
my $sth = $dbh->prepare(qq{ SELECT id, term FROM db_bill_terms ORDER BY id });
$sth->execute();
my $counter = 1;
while (($DB::ID, $DB::NAME) = $sth->fetchrow_array())
{
@NEW::BILLTERMS[$counter] = "<option value=\"$DB::ID\">$DB::NAME";
$counter = $counter + 1;
}
$sth->finish();
$dbh->disconnect();
thanks!
- Scott
Was wondering if the below script was the BEST way to do this -
Is there a way to get rid of $counter?
my $sth = $dbh->prepare(qq{ SELECT id, term FROM db_bill_terms ORDER BY id });
$sth->execute();
my $counter = 1;
while (($DB::ID, $DB::NAME) = $sth->fetchrow_array())
{
@NEW::BILLTERMS[$counter] = "<option value=\"$DB::ID\">$DB::NAME";
$counter = $counter + 1;
}
$sth->finish();
$dbh->disconnect();
thanks!
- Scott