批量生成静态页面(求助+急)

01Byte空间 01Byte空间 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
问题?
1.这样做的很麻烦 请大家给个更好的方法?
2.我的数据库中有896条记录,都是复制的,现在我要实现分页的功能怎么做?
每页显示100条

SQL> insert into TB_ATICLE(title,article, articledatetime,articlesgroup_parent_id,articledescription
)
2 select title,article, articledatetime,articlesgroup_parent_id,articledescription from tb_aticle
;

已创建448行。

SQL> commit;





模板页:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>Index</title>
</head>
<body>
<div> $htmlformat[0]</div>
<br />
<div> $htmlformat[0]</div>

</body>
</html>


<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<title> $htmlformat[0]</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<link href="style.css" type="text/css" rel="stylesheet"/>
<style type="text/css">
<!--
body { margin:0px; font-size:12px;
}
p{text-indent:24px; text-align:left;}
.browser{ border-collapse:collapse; text-align:center; width:95%;}
.PPT{border:1px solid #64b7d7; padding:0px 0px; word-wrap: break-word; word-break:break-all;}
-->
</style>
<!-- 式样表自己制作 -->
</head>
<body>
<table border="0" cellspacing="0" cellpadding="0" style="width:800px;">
<tr><!--文章导航 -->
<td align="left" class="PPT" style="height:30px"> $htmlformat[4]</td>
</tr>

<tr><!--文章的标题 -->
<td align="center" class="PPT" style="height:30px" > $htmlformat[0]</td>
</tr>
<tr><!--发表时间 -->
<td align="center"class="PPT" style="height:30px"> $htmlformat[5]                 $htmlformat[1]</td>
</tr>
<tr><!--文章概述 -->
<td align="left" class="PPT" style="height:60px" valign="top"> $htmlformat[6]<br/>$htmlformat[2]</td>
</tr>
<tr><!--文章内容 -->
<td class="PPT" style="height:200px" valign="top"> $htmlformat[3]</td>
</tr>
</table>
</body>
</html>




数据库:
Article表
create table Aticle
(
Articles_id number(20) primary key,/*自增*/
title varchar2(50) not null,
Article varchar2(3500) not null,
Articledatetime date default sysdate,
Articlesgroup_parent_id number(6),
Articledescription varchar2(500) not null
)
创建自动增长序列
CREATE SEQUENCE newsID_Sequence
  INCREMENT BY 1 -- 每次加几个
  START WITH 1 -- 从1开始计数
  NOMAXVALUE -- 不设置最大值
  NOCYCLE -- 一直累加,不循环
  NOCACHE -- 不建缓冲区
创建触发器
CREATE TRIGGER newsID_Increase BEFORE
insert ON Aticle FOR EACH ROW
begin
select newsID_Sequence.nextval into:New.Articles_id from dual;
end;
提交
commit;


Articlesgroup表
create table Articlesgroup(
Articlesgroup_id number(6),
Groupname varchar2(100) not null,
Articlesgroup_parent_id number(6),
Groupdescription varchar2(500) not null
)

insert into Articlesgroup(Articlesgroup_id,Groupname,Articlesgroup_parent_id,Groupdescription)
values(11,'ASP.NET',1,'IT专区');
insert into Articlesgroup(Articlesgroup_id,Groupname,Articlesgroup_parent_id,Groupdescription)
values(12,'Oracle数据库',1,'IT专区');
insert into Articlesgroup(Articlesgroup_id,Groupname,Articlesgroup_parent_id,Groupdescription)
values(13,'J2EE',1,'IT专区');

ALTER TABLE Aticle RENAME TO tb_Aticle;
insert into tb_Aticle(title,Article,Articlesgroup_parent_id,Articledescription)
values('','',11,'')




...全文

相关推荐

评论 18
收藏 已收藏
分享
返回顶部
01Byte空间
.NET社区 62,272 成员 668,968 内容