上一條 下一條 例項程式碼!
阿新 • • 發佈:2019-01-31
請特別關注紅色的字母,不然會出錯!
dim showprev
set showprev=conn.execute("select top 1 * from jcl_photo where id > "&id&" order by id asc;")
if showprev.eof then
response.Write "上條沒有了"
else
response.Write "<a href=""sub.asp?id="&showprev("id")&""">上一條</a>|||||"
end if
showprev.close
set showprev=nothing
dim shownext
set shownext=conn.execute("select top 1 * from jcl_photo where id < "&id&" order by id DESC;
if shownext.eof then
response.Write "下條沒有了"
else
response.Write "<a href=""sub.asp?id="&shownext("id")&""">下一條</a>"
end if
shownext.close
set shownext=nothing