还是没人知道吗?我把程序贴出来,麻烦帮我看一下:
<?php 
if($m_start_day=="" or $m_end_day=="" or $m_start_machine_id=="" or $m_end_machine_id==""){}
else{
$m_start_day1=substr("$m_start_day",0,8);
$m_end_day1=substr("$m_end_day",0,8);
echo "<table align=center>";
echo "<caption><font size=2>生产加工表&nbsp;&nbsp;".L_start_datt.":$m_start_day1<br>=========&nbsp;&nbsp;".L_end_datt.":$m_end_day1</font></caption>";
echo "</table>";echo "<table width='120%'>";
echo "<tr>";
   echo "<td width=70 align=center><font size=2>".L_part_id."</td><td width=70 align=center><font size=2>".L_partID."</td><td width=70 align=center><font size=2>".L_order_no."</td><td width=80 align=center><font size=2>".L_lot_no."</td><td width=80 align=center><font size=2>".L_procedure_no."</td><td width=70 align=center><font size=2>".L_amount."</td><td width=130 align=center><font size=2>".L_start_datt."</td><td width=90 align=center><font size=2>".L_end_datt."</td>"; 
   echo "</tr><tr>";
   for($m_t=0;$m_t<6;$m_t++){
      echo "<td>-------</td>";
   }
echo "<td>--------------</td>";
echo "<td>---------</td>";
echo "</tr></table>";
   echo "<table width='120%'>";
   $m_sql1="select  distinct machine_id from a800 where machine_id>='$m_start_machine_id' and machine_id<='$m_end_machine_id'";
   $m_query1=sql_query($m_sql1,$link);
   $m_rows1=sql_num_rows($m_query1);
   for($m_k=0;$m_k<$m_rows1;$m_k++){
   list($m_value)=sql_fetch_row($m_query1);
   echo "<tr><td colspan='8'><font size=2>".L_machine_id.":</font>";
   echo  "$m_value</td></tr>";
   $m_sql5="select  a800.part_id,a200.part_id,a800.order_no,a800.lot_no,a800.procedure_no,a800.finish_qty,a800.proc_time,a800.finish_time 
                    from   a200,a800 
where a200.order_no=a800.order_no and a800.proc_time>='$m_start_day' and a800.finish_time<='$m_end_day' and a800.machine_id='$m_value'";
   
   $m_result5=sql_query("$m_sql5",$link);
   $m_fields=sql_num_fields($m_result5); 
   $m_rows5=sql_num_rows($m_result5);
   for($m_i=0;$m_i<$m_rows5;$m_i++){
      $m_p++;
      if(($m_p/3)==floor($m_p/3)){echo "<tr clear=\"all\" style=\"page-break-before:always;\">";
     }else{echo "<tr>"; }
     for($m_j=0;$m_j<$m_fields;$m_j++){
     $m_values5=sql_result($m_result5,$m_i,$m_j);
 echo "<td width=100><center>$m_values5</td>";
    }
  echo "</tr>";  
     }
  //echo "</table>";
      echo "<tr><td colspan='8'><hr width='120%'></td></tr>";
   }
   echo "</table>";
}
?>