getValue(); $a=ico"/> getValue(); $a=ico">
Home >Backend Development >PHP Tutorial > Excel导入mysql数据丢掉
Excel导入mysql数据丢失
昨天晚上弄了一个晚上都没解决,来这里求助下,谢谢各位了
for($j=3;$j<=$highestRow;$j++)//表头不读取<br /> {<br /> $a = $objPHPExcel->getActiveSheet()->getCell("A".$j)->getValue();<br /> $a=iconv("UTF-8","GBK//IGNORE",$a);//转码<br /> $b = $objPHPExcel->getActiveSheet()->getCell("B".$j)->getValue();<br /> $b=iconv("UTF-8","GBK//IGNORE",$b);//转码<br /> //$c = $objPHPExcel->getActiveSheet()->getCell("C".$j)->getValue();<br /> //$d = $objPHPExcel->getActiveSheet()->getCell("D".$j)->getValue();<br /> //$e = $objPHPExcel->getActiveSheet()->getCell("E".$j)->getValue();<br /> $sql = "INSERT INTO paee_course VALUES('".$a."','".$b."')";//,".$c.",".$d.",".$e."<br /> echo $sql."$j</br>";<br /> mysql_query($sql);<br /> /*if(!mysql_query($sql))<br /> {<br /> re_result("导入数据失败,请稍后再试或与管理员联系");<br /> }*/<br /> }