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

上一篇,下一篇過程代碼

 更新時間:2007年02月10日 00:00:00   作者:  

復(fù)制代碼 代碼如下:

Rem==上一篇== 
Rem================================================================ 
Rem= 參數(shù)說明: 
Rem= pid當(dāng)前ID,prame:欄目前輟(如一般web_news表,字段時一般為wn_**,prame就代表wn) 
Rem= ptable(表前輟.如一般表名是:站點名_表名(shenzhe_news) ptable:就代表shenzhe) 
Rem= 說明:采用上面命名法,可使該過程達到通用 
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 = "上一篇:沒有新聞了" 
Else 
     pre = "<a href="&url&".asp?"&id&"="&rs(0)&">"&rs(1)&"</a>" 
End If 
GetPre = pre 
End Function 

Rem = 下一篇 
Rem============= 
Rem= 參數(shù)函意和上過程一樣 
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 = "下一篇:沒有新聞了" 
Else 
     nnext = "<a href="&url&".asp?"&id&"="&rs(0)&">下一篇:"&rs(1)&"</a>" 
End If 
GetNext = nnext 
End Function 

實現(xiàn)代碼: 
偶數(shù)據(jù)庫里有表: 
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)文章

最新評論

平乐县| 化州市| 华池县| 荣昌县| 建始县| 融水| 恩施市| 五莲县| 洛阳市| 曲松县| 石泉县| 金乡县| 获嘉县| 江山市| 寻乌县| 南宁市| 潜山县| 虎林市| 金堂县| 嘉禾县| 福海县| 如皋市| 临湘市| 施甸县| 崇明县| 额尔古纳市| 和林格尔县| 兴文县| 阿城市| 永安市| 会东县| 南城县| 锦州市| 津市市| 镇原县| 永春县| 咸丰县| 泰来县| 湘潭县| 监利县| 屏东市|