我的数据库中有4个字段,name sex age time
例如这个网址www.shangye168.com/get.asp?name=sql 我想从数据库中查询当这个地址栏中的参数name与数据库中的name字段值相等时再页面中显示 sex age time
代码应该怎么写呢...请教各位,帮帮忙啊...
set rs=Server.CreateObject("ADODB.RecordSet")
rs.open"select * from 数据表 where name='"&name&"' order by 字段 ",conn,1,1
*******************************************************************************
输出数据
response.write rs("name")
response.write rs("age")
response.write rs("sex")
response.write rs("time")
set rs=Server.CreateObject("ADODB.RecordSet")
rs.open"select * from 数据表 order by 字段 ",conn,1,1
while not rs.eof
if rs("name")=name then
response.write rs("name")
response.write rs("age")
response.write rs("sex")
response.write rs("time")
end if
rs.movenext()
wend
set rs=Server.CreateObject("ADODB.RecordSet")
rs.open"select * from 数据表 order by 字段 ",conn,1,1
while not rs.eof
if rs("name")=name then
response.write rs("name")
response.write rs("age")
response.write rs("sex")
response.write rs("time")
end if
rs.movenext()
wend