日期:2014-05-16 浏览次数:20537 次
<?php
$src=file("2010.txt");
$file_name = "data2010.sql";
$file_pointer = fopen($file_name, "a");
$i=0;
$k=5542;
foreach ($src as $line) {
$array = explode("\t",$line);
$sql = "INSERT INTO table(classid,onclick,userid,username,ztid,checked,istop,truetime,ismember,dokey,userfen,isgood,filename,fh,groupid,newstempid,plnum,firsttitle,isqf,totaldown,title,newstime,closepl,havehtml,lastdotime,haveaddfen,infopfen,infopfennum,votenum,zhuanye,xueyuan,csyear,xb,mgb,xz,zzmm,contact,comefrom,shehui,win,english,computer,speciality,work,workarea1,workarea2) VALUES ('86','1','1','admin','|','1','0','1259917980','0','0','0','1','$k','0','1','14','0','0','0','0','$array[0]','2010-10-15 19:33:00','0','1','1259917980','0','0','0','0','$array[1]','$array[2]','','$array[3]','','$array[4]','$array[5]','$array[6]','$array[7]','$array[8]','$array[9]','$array[10] ','$array[11]','$array[12]','$array[13]','$array[14]','$array[15]');";
fwrite($file_pointer, $sql);
++$i;
++$k;
}
fclose($file_pointer);
echo "ok!";
?>