最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

上一篇,下一篇過(guò)程代碼

 更新時(shí)間:2007年03月12日 00:00:00   作者:  
Rem==上一篇==
Rem================================================================ Rem= 參數(shù)說(shuō)明:
Rem= pid當(dāng)前ID,prame:欄目前輟(如一般web_news表,字段時(shí)一般為wn_**,prame就代表wn)
Rem= ptable(表前輟.如一般表名是:站點(diǎn)名_表名(shenzhe_news) ptable:就代表shenzhe)
Rem= 說(shuō)明:采用上面命名法,可使該過(guò)程達(dá)到通用
Rem===============================================================
Function GetPre(pid,prame,ptable)
    id = prame&"_id"
title = prame&"_title"
table = "city_"&ptable
url = "show_"&ptable
sql = "SELECT TOP 1 "&id&","&title&" FROM "&table&" WHERE "&id&"<"&pid&" ORDER BY "&id&" DESC"
set rs = Conn.Execute(sql)
If rs.eof or rs.bof Then
     pre = "上一篇:沒(méi)有新聞了"
Else
     pre = "<a href="&url&".asp?"&id&"="&rs(0)&">"&rs(1)&"</a>"
End If
GetPre = pre
End Function

Rem = 下一篇
Rem=============
Rem= 參數(shù)函意和上過(guò)程一樣
Rem==========
Function GetNext(nid,nrame,ntable)
    id = nrame&"_id"
title = nrame&"_title"
table = "city_"&ntable
url = "show_"&ntable
sql = "SELECT TOP 1 "&id&","&title&" FROM "&table&" WHERE "&id&">"&nid&" ORDER BY "&id&" "
set rs = Conn.Execute(sql)
If rs.eof or rs.bof Then
     nnext = "下一篇:沒(méi)有新聞了"
Else
     nnext = "<a href="&url&".asp?"&id&"="&rs(0)&">下一篇:"&rs(1)&"</a>"
End If
GetNext = nnext
End Function

實(shí)現(xiàn)代碼:
偶數(shù)據(jù)庫(kù)里有表:
city_active  city_date  city_note
city_active主要字段有: ca_id,cd_title
city_date主要字段有: cd_id,cd_title
city_note主要字段有: cn_id, cn_title

這樣引用就可:
在show_note.asp?cn_id=4里引用上一篇下一篇
<%=GetPre(cn_id,"cn","note")%> ' 上一篇
<%=GetNext(cn_id,"cn","note")%> ' 下一篇

相關(guān)文章

最新評(píng)論

天峨县| 新宁县| 临邑县| 县级市| 利辛县| 双城市| 广州市| 黔西县| 天峻县| 新余市| 区。| 清河县| 衡水市| 上栗县| 石首市| 开鲁县| 邻水| 喀喇沁旗| 海安县| 建水县| 天等县| 杭锦旗| 竹北市| 玉树县| 平顶山市| 武陟县| 曲麻莱县| 托克托县| 莱西市| 聂荣县| 句容市| 崇明县| 洛阳市| 柘荣县| 中方县| 谷城县| 怀化市| 阳新县| 海淀区| 巩留县| 三原县|