| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 1137 人关注过本帖
标题:字段查询 方面的问题
取消只看楼主 加入收藏
fengmnll
Rank: 1
等 级:新手上路
帖 子:79
专家分:3
注 册:2008-11-6
结帖率:85.71%
收藏
已结贴  问题点数:5 回复次数:3 
字段查询 方面的问题
<!--#include file="conn.asp"-->
<html>
<head>
<link href="css.css" type=text/css rel=stylesheet>
<meta http-equiv="content-type" content="text/html; charset=gb2312">
<script type="text/javascript" src="include/admin.js"></script>
<title>管理学生信息</title>
</head>
<body >
<table width="98%" border="0" align="center" cellpadding="5" cellspacing="1" bgcolor="#000000" class="border">
        <tr class="title">
          <td width="9%" height="25" bgcolor="#A4B6D7"><div align="center">
</div></td>
          <td width="91%" bgcolor="#A4B6D7">
          <form name="form1" method="post" action="#">
            <input type="text" name="major" id="major" >            
            <input type="submit" name="Submit" value="查询" onClick="tanchu">  
          </form></td>
        </tr>
        <tr class="title">
          <td height="90" colspan="2" bgcolor="#A4B6D7"><table width="98%" border="0" align="center" cellpadding="3" cellspacing="1" bgcolor="#000000">
            <tr>
              <td width="10%" height="25" align="center" bgcolor="#cccccc">学号</td>
              <td width="10%" align="center" bgcolor="#cccccc">姓名</td>
              <td width="7%" align="center" bgcolor="#cccccc">性别</td>
              <td width="10%" align="center" bgcolor="#cccccc">入学时间</td>
              <td width="7%" align="center" bgcolor="#cccccc">年龄</td>
              <td width="16%" align="center" bgcolor="#cccccc">籍贯</td>
              <td width="16%" align="center" bgcolor="#cccccc">专业</td>
            </tr>
   <%
   dim major
   major=""
  set rs=server.CreateObject("adodb.recordset")
  rs.open "select * from student where major='"&major&"' ",conn,1,3        
if rs.eof or rs.bof then
response.write ("暂无记录!!")
else
  rs.pagesize=10
  page=clng(request("page"))
  if page<1 then page=1
  rs.absolutepage=page
  for i=1 to rs.pagesize
  %>
            <tr bgcolor="#ffffff">
              <td height="22" align="center"><%=rs("student_id")%></td>
              <td align="center"><%=rs("student_name")%></td>
              <td align="center"><%=rs("sex")%></td>
              <td align="center"><%=rs("in_time")%></td>
              <td align="center"><%=rs("age")%></td>
              <td align="center"><%=rs("homeplace")%></td>
              <td align="center"><%=rs("major")%></td>
            </tr>
          <%
rs.movenext
if rs.eof then exit for
next
end if
%>
          </table>
  <% if page<>1 then %>
<a href=<%=path%>?page=1&page1=<%=clng(page1)%>> 第一页</a>
<a href=<%=path%>?page=<%=(page-1)%>&page1=<%=clng(page1)%>> 上一页</a>
<%end if
if page<>rs.pagecount then %>
<a href=<%=path%>?page=<%=(page+1)%>&page1=<%=clng(page1)%>>下一页</a>
<a href=<%=path%>?page=<%=rs.pagecount%>&page1=<%=clng(page1)%>>最后一页</a>
<%end if %></td>
        </tr>
</table>
</body>
</html>
主要就是想通过某几个字段查询学生的信息,不知道怎么实现呢?谢谢.
搜索更多相关主题的帖子: 查询 字段 
2010-05-26 12:56
fengmnll
Rank: 1
等 级:新手上路
帖 子:79
专家分:3
注 册:2008-11-6
收藏
得分:0 
回复 2楼 gupiao175
我想精确查询,就是通过具体学生所在的专业或者学号,查询学生的信息
2010-05-27 15:39
fengmnll
Rank: 1
等 级:新手上路
帖 子:79
专家分:3
注 册:2008-11-6
收藏
得分:0 
回复 4楼 gupiao175
          <form name="form1" method="post" action="#">
            <input type="text" name=""  id="major">            
            <input type="submit" name="Submit" value="查询" >  
          </form>

不知道form语句应该怎么修改呢?刚才修改了提交查询没有什么反应呢?
2010-05-27 17:20
fengmnll
Rank: 1
等 级:新手上路
帖 子:79
专家分:3
注 册:2008-11-6
收藏
得分:0 
回复 6楼 gupiao175
呵呵,谢谢.好了
2010-05-27 19:07
快速回复:字段查询 方面的问题
数据加载中...
 
   



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

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