本帖最后由 dmf1218 于 2010-06-04 17:17:21 编辑

解决方案 »

  1.   

    for($i=2;$i<($count+2);$i++)
    { $id=
      $objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow(0, $i, $row['st_id']);
      $objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow(1, $i, $row['st_na']);
      $objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow(2, $i, $row['st_cl']);
    }
    改为
    forwhile($row=mysql_fetch_array($rs))

      $objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow(0, $i, $row['st_id']);
      $objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow(1, $i, $row['st_na']);
      $objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow(2, $i, $row['st_cl']);
    }
      

  2.   

    我想过用while  可是i如何循环呢
      

  3.   

    刚才懵了.....循环可以了  可是为什么只能输出数字呢   st_na,st_cl这两个为什么不能输出呢