用Dreamweaver运行,但显示foreach()参数无效是为什么
$objSheet=$objPHPExcel->getActiveSheet();//获取当前活动sheet
$objSheet->setTitle($i."用户表");//给当前活动sheet起个名称
$data=$db->getDataByuid($i);//查询每个年级的学生数据
$objSheet->setCellValue("A1","用户名")->setCellValue("B1","性别")->setCellValue("C1","邮箱")->setCellValue("D1","资料室地址")->setCellValue("E1","角色")->setCellValue("F1","学/工号")->setCellValue("G1","电话")->setCellValue("H1","注册时间")->setCellValue("I1","学生与否")->setCellValue("J1","状态")->setCellValue("K1","头像");//填充数据
$j=2;
foreach($data as $key=>$val){
$objSheet->setCellValue("A".$j,$val['uname'])->setCellValue("B".$j,$val['usex'])->setCellValue("C".$j,$val['email'])->setCellValue("D".$j,$val['mid'])->setCellValue("E".$j,$val['role'])->setCellValue("F".$j,$val['number'])->setCellValue("G".$j,$val['phone'])->setCellValue("H".$j,$val['utime'])->setCellValue("I".$j,$val['student'])->setCellValue("J".$j,$val['status'])->setCellValue("K".$j,$val['portrait']);
$j++;
}
}