<% // keyword คือตัวแปรรับค่าของค้นหา keyWord=Request.QueryString("keyWord") Rem ตั้งจำนวนบรรทัดต่อหน้า PageLen=20 PageNo=Request.QueryString("PageNo") if PageNo="" then PageNo=1 Rem สร้าง Recordset Set RecSet=Server.CreateObject("ADODB.Recordset") if cint(QCat)=0 then Sql="Select * from Question where QTopic like '%"& keyWord &"%' or QDetail like '%"& keyWord &"%' order by qNo Desc" rsText="ค้นหา " & keyWord & "" else Sql="Select * from Question where (QTopic like '%"& keyWord &"%' or QTopic like '%"& keyWord &"%') and QCat like '%"& QCat &"%' order by qNo Desc" rsText="ค้นหาคำถามที่มีคำว่า " & keyWord & " : ในหมวด : " & CatDetail & "" end if RecSet.Open Sql,Conn,1,3 TotalRecord=RecSet.recordcount RecSet.PageSize=PageLen TotalPage=RecSet.PageCount //RecSet.AbsolutePage=PageNo if not RecSet.Eof then RecSet.AbsolutePage=PageNo %> เกี่ยวกับ EnConLab
     
 
     
  ถาม - ตอบ  
     
 
     
ประเด็นปัญหาและความคิดเห็น

ค้นหา(ว่างไว้จะแสดงทุกคำถาม) :  
  <% if session("Admin")<>"" then %> Your Level : <% =session("Admin") %> <% end if %>
<% =rsText %> พบทั้งหมด <% =RecSet.Recordcount %> คำถาม
<% TrBG="#F7F7F7" recNo=1 Rem วนเพื่อแสดงข้อมูลใน Recordset Do while not RecSet.EOF and recNo<= PageLen sqlAnswer ="Select * From Answer Where qNo=" & RecSet("qNo") set RecSet_Answer=Server.CreateObject("ADODB.Recordset") RecSet_Answer.Open sqlAnswer, Conn,1,3 rem RecSet_Answer.movelast Total_Answer=RecSet_Answer.recordcount RecSet_Answer.Close Rem สลับสีบรรทัด if TrBG="#F7F7F7" then TrBG="#E2E2E2" else TrBG="#F7F7F7" end if %> class="link_blue"> <% recNo=recNo+1 RecSet.MoveNext Loop //' Do while not RecSet.EOF and recNo<= PageLen RecSet.Close Conn.Close %>
รหัส หัวข้อ ผู้ถาม ส่งคำถามเมื่อ ผู้ตอบ
<% Qindex=right(("0000" & RecSet("qNo")),5) %> <% =Qindex %> <% =RecSet("Name") %> <% =RecSet("dDate") %> <% =Total_Answer %>

หน้าที่.. | <% Rem Navigation Bar Start ------------------------------------------------- if cint(PageNo)>1 then %> [ <<Back ] <% end if for idx=1 to TotalPage %> <% if idx=cint(PageNo) then %> <% =idx %> | <% else %> <% =idx %> | <% end if %> <% next if cint(PageNo) < cint(TotalPage) then %> [ Next >>] <% end if Rem Navigation Bar End ------------------------------------------------- %>
 

Copyright ©2004 www.enconlab.com