Home > Q & A
   
   
  <% call db_conn() call rs_conn() dim pagesize, pg, sq1, totalpage, finder1, finder2, job '변수 설명 'pagesize : 한페이지에 보여지는 리스트 갯수 'pg : 페이지 번호 'sq1 : 쿼리문 'totalpage : 전체 페이지 갯수 'finder1 : 검색의 종류(1 : 제목, 2 : 내용) 'finder2 : 검색어 if not trim(request("pg"))="" and request("pg")<>cstr(0) then pg=request("pg") else pg=1 end if finder1 = request("finder1") finder2 = request("finder2") job = request("job") if job = "" then job = 1 end if if finder2 <> "" then '검색쿼리 select case finder1 case 1 sq1 = "select * from tb_board where subject like '%"+finder2+"%' and view_yn=1" case 2 sq1 = "select * from tb_board where content like '%"+finder2+"%' and view_yn=1" case 3 sq1 = "select * from tb_board where username like '%"+finder2+"%' and view_yn=1" end select else '검색 없을시 쿼리 sq1 = "select * from tb_board where view_yn=1" end if sq1 = sq1 & " and job = " & job & " order by ref desc, re_step asc" pagesize=15 rs.PageSize = pagesize rs.Open sq1, dbconn, 1 if not rs.eof then rs.AbsolutePage = cint(pg) totalpage=rs.PageCount end if %>
<%if not rs.EOF then dim i, counter 'i : 루프문 상수 'counter : 게시물 번호메김 for i = 1 to pagesize%> <% rs.MoveNext if rs.eof then exit for end if next end if call rs_close() call db_close() %>
번 호 작성자 제 목 작성일 조회수
<%counter=rs.RecordCount-(i-1+(cint(pg)-1)*pagesize)%> <%= counter %> <%= rs("username") %> <%if rs("re_level") > 0 then%> " height=10> <% end if %> &pg=<%=pg%>&finder1=<%=finder1%>&finder2=<%=finder2%>&ref=<%=rs("ref")%>&job=<%=job%>" onmouseover="show('<%=counter%>')" onmouseout="hidden('<%=counter%>')"> <%= rs("subject") %> <%= left(rs("regdate"),10) %> <%= rs("viewcount") %> <%Dim content content = replace(rs("content"),chr(10),"
") content = replace(content," "," ")%>
" name="finder1">