| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 495 人关注过本帖
标题:请教如何在单表单段查询上加入多段查询?
只看楼主 加入收藏
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
快速回复:请教如何在单表单段查询上加入多段查询?
数据加载中...
 
   



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

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