ClassicASP 이전글 다음글 추가하기
페이지 정보
본문
<%
idx = request("idx")
sql = "select * from 테이블명 where IDX='"& idx &"' "
'response.write sql
set rs = Server.CreateObject("ADODB.Recordset")
rs.open sql,db,1
if not rs.EOF or not rs.BOF then ' 자료가 있을때
subject = rs("subject")
end if
%>
<%
Dim prev_num, prev_title, next_num, next_title
'이전글보기
sql=""
sql=sql & "select idx from Samik_PRCenter where ptype='PAPER' and idx<"& idx &" order by idx desc"
set rs = Server.CreateObject("ADODB.Recordset")
rs.open sql,db,1
if rs.bof or rs.eof Then
prev_num = ""
prev_title = ""
else
prev_num = rs("idx")
end if
rs.close()
'다음글보기
sql=""
sql=sql & "select idx from Samik_PRCenter where ptype='PAPER' and idx>"& idx &" order by idx desc"
set rs = Server.CreateObject("ADODB.Recordset")
rs.open sql,db,1
if rs.bof or rs.eof Then
next_num = ""
next_title = ""
else
next_num = rs("idx")
end if
rs.close()
%>
참고자료
http://tip.daum.net/question/55627296
idx = request("idx")
sql = "select * from 테이블명 where IDX='"& idx &"' "
'response.write sql
set rs = Server.CreateObject("ADODB.Recordset")
rs.open sql,db,1
if not rs.EOF or not rs.BOF then ' 자료가 있을때
subject = rs("subject")
end if
%>
<%
Dim prev_num, prev_title, next_num, next_title
'이전글보기
sql=""
sql=sql & "select idx from Samik_PRCenter where ptype='PAPER' and idx<"& idx &" order by idx desc"
set rs = Server.CreateObject("ADODB.Recordset")
rs.open sql,db,1
if rs.bof or rs.eof Then
prev_num = ""
prev_title = ""
else
prev_num = rs("idx")
end if
rs.close()
'다음글보기
sql=""
sql=sql & "select idx from Samik_PRCenter where ptype='PAPER' and idx>"& idx &" order by idx desc"
set rs = Server.CreateObject("ADODB.Recordset")
rs.open sql,db,1
if rs.bof or rs.eof Then
next_num = ""
next_title = ""
else
next_num = rs("idx")
end if
rs.close()
%>
참고자료
http://tip.daum.net/question/55627296
댓글목록
등록된 댓글이 없습니다.