数据库输出静态html<?php
ob_start();//打开缓冲区
set_time_limit(0);
?>
<?php
//include("pageft.php"); //包含“pageft.php”文件$fp=mysql_connect("localhost","root","");
mysql_select_db("wssjk",$fp);
//取得总信息数
$result=mysql_query("select * from ws");
$total=mysql_num_rows($result);
for($i=0;$i<$total;$i++){
$j=$i+1;
$result2=mysql_query("select * from ws where id=$j ");
while($row=mysql_fetch_array($result2)){
//以下都输出到缓存
echo $row[0];
echo "</br>";
echo $row[1];
echo "</br>";
echo $row[2];
echo "</br>";
}//end while
$content = ob_get_contents();//取得php页面输出的全部内容
ob_end_clean();
$fp = fopen("jt/$j".".html", "w");
fwrite($fp, $content);
fclose($fp);
ob_start();
}//end for
//mysql_close($fp);?>
ob_start();//打开缓冲区
set_time_limit(0);
?>
<?php
//include("pageft.php"); //包含“pageft.php”文件$fp=mysql_connect("localhost","root","");
mysql_select_db("wssjk",$fp);
//取得总信息数
$result=mysql_query("select * from ws");
$total=mysql_num_rows($result);
for($i=0;$i<$total;$i++){
$j=$i+1;
$result2=mysql_query("select * from ws where id=$j ");
while($row=mysql_fetch_array($result2)){
//以下都输出到缓存
echo $row[0];
echo "</br>";
echo $row[1];
echo "</br>";
echo $row[2];
echo "</br>";
}//end while
$content = ob_get_contents();//取得php页面输出的全部内容
ob_end_clean();
$fp = fopen("jt/$j".".html", "w");
fwrite($fp, $content);
fclose($fp);
ob_start();
}//end for
//mysql_close($fp);?>
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货