日期:2014-05-17 浏览次数:20761 次
for($j=3;$j<=$highestRow;$j++)//表头不读取
{
$a = $objPHPExcel->getActiveSheet()->getCell("A".$j)->getValue();
$a=iconv("UTF-8","GBK//IGNORE",$a);//转码
$b = $objPHPExcel->getActiveSheet()->getCell("B".$j)->getValue();
$b=iconv("UTF-8","GBK//IGNORE",$b);//转码
//$c = $objPHPExcel->getActiveSheet()->getCell("C".$j)->getValue();
//$d = $objPHPExcel->getActiveSheet()->getCell("D".$j)->getValue();
//$e = $objPHPExcel->getActiveSheet()->getCell("E".$j)->getValue();
$sql = "INSERT INTO paee_course VALUES('".$a."','".$b."')";//,".$c.",".$d.",".$e."
echo $sql."$j</br>";
mysql_query($sql);
/*if(!mysql_query($sql))
{
re_result("导入数据失败,请稍后再试或与管理员联系");
}*/
}