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

php access数据导入mysql

PHP中文网
Release: 2016-05-25 17:01:18
Original
1319 people have browsed it

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]
	);
	/*这里是插入语句了*/
}
?>
Copy after login

                   

Related labels:
source:php.cn
Statement of this Website
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
Latest Articles by Author
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template