本帖最后由 zhan170 于 2015-2-26 21:02 编辑
[PHP] 纯文本查看 复制代码 <?php
header('Content-type: text/html; charset=utf-8');
/*
文件功能:取mdb数据库数据生成html文件
*/
$conn = [url=home.php?mod=space&uid=148153]@new[/url] COM("ADODB.Connection") or die ("ADO连接失败!");
$connstr = "DRIVER={Microsoft Access Driver (*.mdb)};DBQ=". realpath("SpiderResult.mdb");
$conn->Open($connstr);
$rs = new com("ADODB.RecordSet");
$rs->Open("select * from Content",$conn,1,3);
$fp_write = fopen("data.html","w");
while(! $rs->eof) {
$biaoti = $rs->Fields(3)->value;
$neirong=$rs->Fields(4)->value;
fwrite($fp_write,$biaoti."<br>".$neirong."<br>");
$rs->MoveNext();
}
fclose($fp_write);
echo "<a href=data.html>打开</a>";
echo "over";
?>
目录附图
|