标题:请教如何在单表单段查询上加入多段查询?
只看楼主
a190066
Rank: 4
等 级:业余侠客
威 望:2
帖 子:175
专家分:204
注 册:2010-6-24
结帖率:79.07%
 问题点数:0 回复次数:3 
请教如何在单表单段查询上加入多段查询?
请问如何在以下的单表单段(question)关键查询里加入“question1”、“question2”二个段进行多段关键字查询?谢谢!

<%
 if request("userid123")="" then
 sql="select * from users order by id desc"
 else
 sql="select * from users where question='"&request("userid123")&"'"
 end if
 Set rs= Server.CreateObject("ADODB.Recordset")
 rs.open sql,conn,1,1
  if rs.eof and rs.bof then
       response.write "<p align='center'>你查的这个内容不存</p>"
   else
      totalPut=rs.recordcount
      totalPut=rs.recordcount
      if currentpage<1 then
          currentpage=1
      end if
      if (currentpage-1)*MaxPerPage>totalput then
       if (totalPut mod MaxPerPage)=0 then
         currentpage= totalPut \ MaxPerPage
       else
          currentpage= totalPut \ MaxPerPage + 1
       end if

      end if
       if currentPage=1 then
           showpage totalput,MaxPerPage,"Find-8a.asp"
            showContent
            showpage totalput,MaxPerPage,"Find-8a.asp"
       else
          if (currentPage-1)*MaxPerPage<totalPut then
            rs.move  (currentPage-1)*MaxPerPage
            dim bookmark
            bookmark=rs.bookmark
           showpage totalput,MaxPerPage,"Find-8a.asp"
            showContent
             showpage totalput,MaxPerPage,"Find-8a.asp"
        else
            currentPage=1
           showpage totalput,MaxPerPage,"Find-8a.asp"
           showContent
           showpage totalput,MaxPerPage,"Find-8a.asp"
          end if
       end if
   end if
   sub showContent
       dim i
       i=0

  %>

搜索更多相关主题的帖子: 表单 查询 
2010-06-26 13:33
o仰o
Rank: 2
等 级:论坛游民
帖 子:29
专家分:27
注 册:2010-6-10
得分:0 
sql="select * from users where question='"&request("userid123")&"'"  后面加个OR多个条件
2010-06-26 18:26
a190066
Rank: 4
等 级:业余侠客
威 望:2
帖 子:175
专家分:204
注 册:2010-6-24
得分:0 
回复 2楼 o仰o
可否详细一点?谢谢!
2010-06-26 20:32
a190066
Rank: 4
等 级:业余侠客
威 望:2
帖 子:175
专家分:204
注 册:2010-6-24
得分:0 
hams  我刚入门。你在那,帮我一把吧。谢谢你。请教如何在单表单段查询上加入多段查询?
2010-06-27 02:05



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-311315-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.083502 second(s), 8 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved