Home >php教程 >PHP源码 >php access数据导入mysql

php access数据导入mysql

PHP中文网
PHP中文网Original
2016-05-25 17:01:181318browse

php access数据导入mysql,大家应该都会的,勿喷哦,有错就改哈

Open($connstr); 
$rs = @new COM("ADODB.RecordSet"); 
$rs->Open("select * from TABLE_NAME",$conn,1,3); 
while(!$rs->eof){
	$ftitle[]=iconv('GB2312','UTF-8',$rs->Fields["c_title"]->Value);
	$fcontent[]=iconv('GB2312','UTF-8',$rs->Fields["c_content"]->Value);
	$fcdate[]=strtotime($rs->Fields["c_date"]->Value);
	$rs->Movenext(); //将记录集指针下移 	
} 
$rs->close(); 
for ($i=0;$i$ftitle[$i],
	"b_content"=>$fcontent[$i],
	"b_date"=>$fcdate[$i]
	);
	/*这里是插入语句了*/
}
?>

                   

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn