查询数据到当前页面的问题

summily 2009-07-13 01:44:15
在一个页面上选上年月后 一点击查看 怎么让他在这些个按钮下面显示查询的结果
...全文
69 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
summily 2009-07-14
  • 打赏
  • 举报
回复
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<style type="text/css">
.Tab{ border-collapse:collapse; width:700px; height:300px;}
.Tab td{ border:solid 1px #000000}
</style>
</head>


<body>

<%
sort1 = trim(request.form("sort"))
yeare = trim(request.Form("year"))
quarter = trim(request.form("quarter"))


%>


<form name="form1" method="post" action="order.asp">
<table width="391" class="Tab">
<tr>
<td width="183" height="29" align="center">
<INPUT TYPE="RADIO" NAME="sort" checked="checked"/>大区
<INPUT TYPE="RADIO" NAME="sort" />客服部
</td>
<td width="205" align="center"><input type="text" value="<%=yeara%>" name="year" size="7" />

<select name="quarter" >
<option value="1月">1月 </option>
<option value="2月">2月 </option>
<option value="3月">3月 </option>
<option value="4月">4月 </option>
<option value="5月">5月 </option>
<option value="6月">6月 </option>
<option value="7月">7月 </option>
<option value="8月">8月 </option>
<option value="9月">9月 </option>
<option value="10月">10月 </option>
<option value="11月">11月 </option>
<option value="12月">12月 </option>
</select>
<input type="Submit" name="Submit" value="查看" >

</td>
</tr>
<td colspan="2" align="left">
<%
set rs=server.createobject("adodb.recordset")
sql="SELECT * FROM section WHERE [year] = 'yeare' "
rs.open sql,conn,1,1
if not rs.eof then
for i=0 to rs.recordcount-1
response.write " <tr>"
for j=0 to rs.fields.count-1
response.write " <td>"&rs.fields(j)&" </td>"
next
response.write " </tr>"
rs.movenext
next
rs.close
end if
set rs=nothing
conn.close
set conn=nothing

%>

</td>
</tr>

</table>
</form>


</body>
</html>
summily 2009-07-14
  • 打赏
  • 举报
回复
还是不会啊
toury 2009-07-13
  • 打赏
  • 举报
回复
这也要代码啊,你真懒!呵呵
<!--#include file='你的数据库连接文件'-->
<%

set rs=server.createobject("adodb.recordset")
sql="SELECT * FROM 表 WHERE 时间字段 LIKE'%"&request("你那个时间控件的NAME")&"%'"
rs.open sql,conn,1,1

if not rs.eof then
response.write "<table border=1>"
for i=0 to rs.recordcount-1
response.write "<tr>"
for j=0 to rs.fields.count-1
response.write "<td>"&rs.fields(j)&"</td>"
next
response.write "</tr>"
rs.movenext
next
rs.close
response.write "</table>"
end if
set rs=nothing
conn.close
set conn=nothing
%>
summily 2009-07-13
  • 打赏
  • 举报
回复
能不能详细点 贴点代码上来 我想写把查到的数据写table里面
toury 2009-07-13
  • 打赏
  • 举报
回复
按照设定条件读库呗,数据读出来,看你用什么控件装数据了,喜欢TABLE就用TABLE,熟悉DIV+CSS布局就用DIV。你的意思可能是使用DIV吧

28,406

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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