MySQL操作程序四十五(mscenq1_start.pl)

返回


# $t{sql} .= $t{ourref0} . '",1,1,"B","C","C","1","1","' . $t{enq2_id} . '","C")'; $t{sql} .= $t{ourref0} . '",1,1,"B","C","C","1","1","' . $t{enq2_id} . '","1")'; # $t{sql} .= $t{ourref0} . '","'. $t{owner1} . '","' . $t{ownerno1} . '","' . $t{hullnoid1} . '","B","C","C","1","1","' . $t{enq2_id} . '","C")'; $t{sql} .= $t{ourref0} . '","'. $t{owner1} . '","' . $t{ownerno1} . '","' . $t{hullnoid1} . '","B","C","C","1","1","' . $t{enq2_id} . '","1")'; ------------------------------------------------------------------------------- [error] [client 127.0.0.1] Use of uninitialized value in foreach loop entry at ./pro/mscenq1_start.pl line 346 346:for $n (1 .. $t{end1} ) { ==>增加如下部分 if ( !($t{end1}) ) { $t{end1} = 20; # 显示项目的最大数量 $aref = $self->dbh->selectall_arrayref("SELECT id,time,ourref,ownerno,hullnoid from enq1 ORDER BY id DESC LIMIT $t{end1}"); for $row ( @$aref ) { ($t{id1},$t{time1},$t{ourref1},$t{ownerno1},$t{hullnoid1}) = @$row; $t{shipname} = $self->dbh->selectrow_array("SELECT name FROM hull_no WHERE id = $t{hullnoid1}"); $t{orderno} = $self->dbh->selectrow_array("SELECT orderno FROM order1 WHERE id = $t{id1} and orderno is not NULL"); $t{post} = $self->dbh->selectrow_array("SELECT post FROM order1 WHERE id = $t{id1} and post is not NULL"); push(@{ $t{list_id} }, $t{id1}); push(@{ $t{list_time} }, $t{time1}); push(@{ $t{list_ourref} }, $t{ourref1}); push(@{ $t{list_ownerno} }, $t{ownerno1}); push(@{ $t{list_shipname} }, $t{shipname}); push(@{ $t{list_orderno} }, $t{orderno}); if ( $t{post} ne 'NO' ) { push(@{ $t{list_post} }, $t{post}); } else { $t{post} = ''; push(@{ $t{list_post} }, $t{post}); } } }
注意:2018年为止! if ( $t{year} == 0 ) { $t{year} = 'A'; } elsif ($t{year} == 1) { $t{year} = 'B'; } elsif ($t{year} == 2) { $t{year} = 'C'; } elsif ($t{year} == 3) { $t{year} = 'D'; } elsif ($t{year} == 4) { $t{year} = 'E'; } elsif ($t{year} == 5) { $t{year} = 'F'; } elsif ($t{year} == 6) { $t{year} = 'G'; } elsif ($t{year} == 7) { $t{year} = 'H'; } elsif ($t{year} == 8) { $t{year} = 'I'; }
返回