|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
对于中小型web应用来说,php有很强的竞争力,linux+apache+mysql+php(lamp)的组合几乎可以胜任绝大多数网站的解决方案,对于大型应用来讲,对于系统架构要求更高,需要有成熟的框架支持,jsp的struts是个不错的框架,国内介绍它的资料也非常多,应用逐渐广泛起来。asp就不用说了,分页工夫干系,没有经由完整测试,这个是也许意义。
CREATEPROCEDUREgetnotes
@forumIDvarchar(10),
@a_intPageNoint,
@a_intPageSizeint,
@rootIDvarchar(10)
AS
declare@m_intRecordNumberint
declare@m_intStartRecordint
declare@pagecountint
declare@tempint
declare@endint
declare@sqlvarchar(500)
declare@bbsnamevarchar(25)
declare@articlesint
declare@managervarchar(30)
declare@selectrootIDvarchar(500)
declare@temprootIDvarchar(10)
select@m_intRecordNumber=@a_intPageSize*@a_intPageNo
select@m_intStartRecord=@a_intPageSize*(@a_intPageNo-1)+1
setnocounton
select@bbsname=subjectname,@manager=manager,@articles=articlesfrombbs_subjectswheresubjectID=@forumID
if@rootID=0
begin
--select@sql=declarem_curTempScrollcursorforselectID,title,shrink,rootID,orderID,pubtime,hits,bytes,username,emailfrombbs_forum_+@forumID+WHERErootIDin(selectdistinctrootIDfrombbs_forum_+@forumID+)orderbyrootIDdesc,orderIDasc
select@sql=declarem_curTempScrollcursorforselectrootIDfrombbs_forum_+@forumID+whererootID=parentIDorderbyrootIDdesc
end
else
select@sql=declarem_curTempScrollcursorforselectID,title,shrink,rootID,orderID,pubtime,hits,bytes,username,emailfrombbs_forum_+@forumID+whererootID=+@rootID+orderbyorderIDasc
exec(@sql)
openm_curTemp
set@pagecount=case
when@@cursor_rows%@a_intPageSize=0then@@cursor_rows/@a_intPageSize
when@@cursor_rows%@a_intPageSize0then@@cursor_rows/@a_intPageSize+1
end
if@@cursor_rows<@a_intPageSizeand@@cursor_rows>0
begin
select@pagecount=1
end
if@rootID=0
begin
set@temp=1
set@selectrootID=0
fetchabsolute@m_intStartRecordfromm_curTempinto@temprootID
while@@fetch_status=0and@temp<@a_intPageSize
begin
set@temp=@temp+1
select@selectrootID=@selectrootID+,+@temprootID
fetchnextfromm_curTempinto@temprootID
end
CLOSEm_curTemp
DEALLOCATEm_curTemp
setnocountoff
selectpagecount=@pagecount
selectbbsname=@bbsname
selectmanager=@manager
selectarticles=@articles
select@sql=declarecurTempScrollcursorforselectID,title,shrink,rootID,orderID,Images,pubtime,hits,bytes,username,emailfrombbs_forum_+@forumID+whererootIDin(+@selectrootID+)orderbyrootIDdesc,orderIDasc
exec(@sql)
opencurTemp
fetchfirstfromcurTemp
while@@fetch_status=0
begin
fetchnextfromcurTemp
end
CLOSEcurTemp
DEALLOCATEcurTemp
end
else
begin
set@temp=1
setnocountoff
fetchabsolute@m_intStartRecordfromm_curTemp
while@@fetch_status=0and@temp<@a_intPageSize
begin
set@temp=@temp+1
fetchnextfromm_curTemp
end
CLOSEm_curTemp
DEALLOCATEm_curTemp
end
</p>缺点:安全性不是太差了,还行,只要你充分利用系统自带的工具;唯一缺点就是执行效率慢,如何进行网站优化以后,效果会比较好。 |
|