<%id=request.QueryString("id") set rs=server.CreateObject("adodb.recordset") rs.open"select * from news where id="&id,conn,1,1 if rs.eof and rs.bof then response.Write("") else response.Write rs("title") response.Write("<br>") response.Write rs("content") response.Write("<p>") end if
set rs=Server.CreateObject("ADODB.RecordSet") sql= "select * from news where id<"&id&" order by id desc" rs.open sql,conn,1,1 if not rs.eof then response.Write("上一篇:<a href=news.asp?id="&rs("id")&">"&rs("title")&"</a>") else response.Write("上一篇:已经到最前一篇了") end if response.Write(" ")
set rs=Server.CreateObject("ADODB.RecordSet") sql= "select * from news where id>"&id&"" rs.open sql,conn,1,1 if not rs.eof then response.Write("下一篇:<a href=news.asp?id="&rs("id")&">"&rs("title")&"</a>") else response.Write("下一篇:已经到最后一篇了") end if %> |