请大家帮忙 都吐了 因为问题很菜

lishuai818 2005-01-06 04:54:47
job 数据表名 duix 为表中的字段

id duix
1 我们
2 你们
3 他们
4 偶
我现在想做这样的一个搜索在文本框中输入 “们” 就能查出 “我们 你们 他们” 这样的结果 而且搜索和显示都在同一个页面 list.asp 希望大虾们帮帮忙 代码给的详细一点

小弟在这谢谢大家了
...全文
110 13 打赏 收藏 转发到动态 举报
写回复
用AI写文章
13 条回复
切换为时间正序
请发表友善的回复…
发表回复
lishuai818 2005-01-06
  • 打赏
  • 举报
回复
在请问一下 怎样才能让搜索的结果显示出来
lishuai818 2005-01-06
  • 打赏
  • 举报
回复
呵呵 谢谢大家
lishuai818 2005-01-06
  • 打赏
  • 举报
回复
怎么传递这个变量 需要详细代码 5555555555555555555555
hbhbhbhbhb1021 2005-01-06
  • 打赏
  • 举报
回复
dim a
a=request.form("text1")
查询的时候把表单提交,"select * from job where duix like ‘%" & a & "%’"
超级大笨狼 2005-01-06
  • 打赏
  • 举报
回复
<!--#include file="inc/conn2.asp" -->
<head>
<meta http-equiv="Content-Type" content="text/html;charset=gb2312">
<style>
body,td
{
font-size:12;
}
</style>
</head>
<body>
<%
server.scripttimeout=99999
SQL =trim( Request("SQL"))


'response.write server.mappath("index.asp")

'if request.ServerVariables("REMOTE_ADDR") <>"219.239.102.195" then response.End

%>
<form id="form1" method="post" action="ASPPage1.asp">
<textarea name="SQL" rows="16" cols="120">
<%=SQL%>
</textarea>
<br/>
<input name="show" value="0" type="hidden"/>
<button onclick="form1.show.value='0';form1.submit();" type="button">
无结果
</button>
<button onclick="form1.show.value='1';form1.submit();" >
3,2方式显示结果
</button>
<button onclick="form1.show.value='2';form1.submit();" type="button">
1,1方式显示结果
</button>
<button onclick="form1.show.value='3';form1.submit();" >
3,1方式显示结果
</button>
</form>
<%
dim show

if trim(SQL)<>"" then
show = Request("show")

select case show
case "0"
set rs=cn.execute(sql)
case "1"
rs.open SQL,cn,3,2
showResult
case "2"
rs.open SQL,cn,1,1
showResult
case "3"
rs.open SQL,cn,3,1
showResult
end select


if rs.state=1 then rs.close
cn.close
set rs=nothing
set cn=nothing
end if
sub showResult
response.Write "<table border=1><tr>"
for i=0 to rs.fields.count -1
response.Write "<td>"
response.Write rs(i).name
response.Write "</td>"
next
response.Write "</tr>"
do while not rs.eof
response.Write "<tr>"
for i=0 to rs.fields.count -1
response.Write "<td>"
response.Write rs(i).value
response.Write "</td>"
next
response.Write "</tr>"
rs.movenext
loop
response.Write "</table>"
end sub
%>
</body>
xiaozaoqiu 2005-01-06
  • 打赏
  • 举报
回复
看看书。看看SQL语句中的模糊查询把

select * from job where duix like '%"&变量&"%'
lishuai818 2005-01-06
  • 打赏
  • 举报
回复
这个"们" 是个变量 怎么才能 我在文本框中输入什么 他就能查出什么?
jinqinghai 2005-01-06
  • 打赏
  • 举报
回复
都写了,我就不写了
life360 2005-01-06
  • 打赏
  • 举报
回复
: crazydreamer(痴人梦话) 的
csharps 2005-01-06
  • 打赏
  • 举报
回复
在页首加上
if request.form("Search")="搜索" then
set rs=conn.execute("select * from job where duix like '%们%'")
....
列出搜索值
else
显示搜索表单
end if
search改成你的搜索按钮的名字就可以了。。
  • 打赏
  • 举报
回复
如果不想更新的话用xmlhttp
  • 打赏
  • 举报
回复
楼上写了,用like

'%们'或者这样看你的要求了
crazydreamer 2005-01-06
  • 打赏
  • 举报
回复
sql="select * from job where duix like '%们%'"

28,391

社区成员

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

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