请给于指点!我想在网页上实现多次查询!

shgciom 2002-03-20 01:17:24
网上有个分数查询系统,但是每次只能查一个号码!总觉得很慢,能不能编个程序实现一次就能把一个范围中的成绩都查出来?网上的查询代码如下:
<form action=/cgi-bin/exam/gra_search_name method=post
name=search >
<div align=center>考号:
<input name=kaohao size=15>
<br><br>
<input name=Submit type=submit value=查询>
<input name=Submit type=reset value=清除>
</div>
</form>
在本地把/cgi-bin/exam/gra_search_name前面添加上全部的网址就能查询,要多次查询要怎么实现?
...全文
74 10 打赏 收藏 转发到动态 举报
写回复
用AI写文章
10 条回复
切换为时间正序
请发表友善的回复…
发表回复
可乐加水 2002-04-27
  • 打赏
  • 举报
回复
<form action=/cgi-bin/exam/gra_search_name method=post
name=search >
<div align=center>考号:
<input type=text name=fenshu1 size=15>
<input type=text name=fenshu2 size=15>
<br><br>
<input name=Submit type=submit value=查询>
<input name=Submit type=reset value=清除>
</div>
</form>

gra_search_name.java//部分代码
import java.sql.*;

//

String fenshu1=request.getParameter("fenshu1");
String fenshu2=request.getParameter("fenshu2");
String sql==" select * from data where 分数 between " + fenshu1 +"and "+fenshu2
//数据库联接
rs=st.execute(sql);

hcgui 2002-04-26
  • 打赏
  • 举报
回复
up
shgciom 2002-04-25
  • 打赏
  • 举报
回复
网页的确不是我做的!
当时也的确是一个一个的查出来的!
但是真的就不能实现吗?
我现在想到了网上游戏使用的挂机程序,或者网上精灵,不知道那到底是怎么编的?
fogwater 2002-03-28
  • 打赏
  • 举报
回复
我这边有一个我做的,你看看吧
<% @language="vbscript" %>
<% response.buffer=true%>
<%
Page = Request("Page")
key=Request("key")
set conn =server.CreateObject("ADODB.Connection")
dbpath = server.MapPath("data\data.mdb")
connectionstring="Provider=Microsoft.Jet.OLEDB.4.0; Data Source="&dbpath
conn.open connectionstring
set rs=server.createobject("ADODB.Recordset")
sql=" select * from data where instr(news_name,'" & key & "') >0"
sql=sql & " Order by news_id Desc"
rs.open sql,conn,3
rs.PageSize = 10
myself="search.asp"
if Not IsEmpty(Request("Page")) then

Page = CInt(Request("Page"))


if Page > RS.PageCount then
RS.AbsolutePage = RS.PageCount

elseif Page <= 0 then
RS.AbsolutePage = 1
else

RS.AbsolutePage = Page
end if
End if

current_page=rs.absolutepage

%>


<html>
<head>
<style type="text/css">
<!--
.small { font-family: "宋体"; font-size: 9pt; vertical-align: middle; line-height:16pt;}
.topic { font-family: "宋体"; font-size: 11pt; vertical-align: middle; line-height:16pt;}
a:link {color:#0F56A3; font-style:normal; cursor:hand; text-decoration:normal}
a:visited {color:#0F56A3; font-style:normal; text-decoration:normal}
a:active {color:#0F56A3; font-style:normal; text-decoration:normal}
a:hover {color:#CC0000; font-style:bold; text-decoration:none}
-->
</style>
<title>搜索结果</title>
<meta http-equiv="Content-Type" content="text/html" charset="GB2312">
</head>
<body>
<table border="1" cellspacing="0" cellpadding="1" bordercolorlight="#dfdfdf" bordercolordark="#ffffff" align="center">
<tr bgcolor="#cccce6">
<td align="center" class="topic" colspan="6" >以下是您所查找的信息,共<%=rs.recordcount%>条</td>
</tr>
<tr bgcolor="#ffefbf" class="small">
<td width="120">
<div align="center">姓名</div>
</td>
<td width="120">
<div align="center">获奖类别</div>
</td>
<td width="120">
<div align="center">班级</div>
</td>
<td width="50">
<div align="center">性别</div>
</td>
<td width="140">
<div align="center">院系</div>
</td>

</tr>
<%

For i = 1 to rs.PageSize
If rs.EOF Then Exit For
%>
<tr bgcolor="#bdf3eb" class="small">
<%if rs("news_comment")<>"" then%>
<td><div align="center"><a href="disp.asp?News_ID=<%=rs("news_id")%>"><%=rs("news_name")%>(图文)</a></div></td>
<% else %>
<td><div align="center"><%=rs("news_name")%></a></div></td>
<% end if%>
<td><div align="center"><%=rs("news_class_name")%></div></td>
<td><div align="center"><%=rs("news_grade")%></div></td>
<td><div align="center"><%=rs("news_sex")%></div></td>
<td><div align="center"><%=rs("news_yx")%></div></td>
</tr>
<%
rs.MoveNext
next
%>
<tr bgcolor="#eaeaf4" class="small">
<td colspan=6 align=center>共<%=rs.PageCount%>页</td>
</tr>
</table>
<%
If rs.PageCount > 1 then
%>
<br>
<div align="center">
  
<font size=2><a href="<%=MySelf%>?key=<%=request("key")%>&Page=<%=(current_page - 1)%>">上一页
</a> 
<%

For i = 1 to rs.PageCount
If i = Page then
color = "Red"
response.write " <Font color=" + color + ">" + Cstr(i) + "</Font> "
Else
color = "Black"
response.write " <a href=" + MySelf + "?key="+request("key")+"&Page=" + Cstr(i) + "><Font color=" + color + ">[" + Cstr(i) + "]</Font></a> "
End If
Next
%>
<a href="<%=MySelf%>?key=<%=request("key")%>&Page=<%=(current_page + 1)%>">下一页
</a></font>
</div>
<%
End If
%>


</body>
</html>
weidegong 2002-03-25
  • 打赏
  • 举报
回复
用JavaScript程序,提取返回页面的数据,这是可行的。
colababy 2002-03-22
  • 打赏
  • 举报
回复
服务器程序如果没有对数据库查询进行相应处理,仅在客户端通过修改<form>来达到一次时间触发,查询多种结果的功能是不现实的!

但是我在想是否可以做一个模拟多次查询的程序,用JS设置响应事件。
superszhu 2002-03-21
  • 打赏
  • 举报
回复
用组合查询,比如加上考号查询,分数范围查询,
模糊查询等,在后台根据页面的输入而产生不同的SQL语句
scarab 2002-03-21
  • 打赏
  • 举报
回复

shgciom (一条小鱼)

你也可以取到输入的数据,然后在程序中根据得到的数据自定义范围(例如上下幅度为10分)
SQL:select xxx from xxx where 分 between xx and xx ....
就可以搞定了
RedFire 2002-03-21
  • 打赏
  • 举报
回复
各位,注意,好象那个网页不是他做的。

shgciom,如果那个网页不是你做的话。没有办法了,一条一条的查吧。因为,就算你这边送了再多的参数过去,服务器那边不处理,你也是白费劲。
supershot 2002-03-20
  • 打赏
  • 举报
回复
当然可以啊,加多文本框,输入范围,SELECT的时候加上范围就取出一批数据显示出来

81,092

社区成员

发帖
与我相关
我的任务
社区描述
Java Web 开发
社区管理员
  • Web 开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧