Couldn't you use a where clause in the sql query to only grab the ones with quantity and skid set?
Your code is pretty confusing for a couple reasons. The use of print mixed in with your insertion of text into an array ref mixed with that incrementing variable makes it hard to follow.
The following does the same thing as your code does, but I think it makes it clear exactly what is going on. I'm still confused by the mix of printing plain text with HTML, and the strings your are putting into the array are odd as well.
my $ordno = 1;
while (my $ref = $GetWOData->fetchrow_hashref()) {
print "$ref->{'Ord_No'}\n";
print "$ref->{'Item_No'}\n";
print "<input type=\"text\" name=\"qty$ordno\" value=\"\" size=\
+"6\">\n"; #Qty of parts
print "$ref->{'Item_Desc_1'}\n";
print "<input type=\"text\" name=\"skd$ordno\" value=\"\" size=\
+"6\">\n"; #Num of skids
print "$ref->{'Cus_Name'}\n";
push @{$orders[$ordno]}, "$ref->{'Ord_No'} | $ref->{'Item_No'}";
push @{$orders[$ordno]}, "0";
push @{$orders[$ordno]}, "$ref->{'Item_Desc_1'} | $ref->{'Item_Desc_
+2'}";
push @{$orders[$ordno]}, "0";
push @{$orders[$ordno]}, "$ref->{'Cus_Name'}";
$ordno++;
}
$GetWOData->finish();
|