主题:ASP网站搜索设置问题
在做一个asp网站搜索功能时遇到了问题:
采用的mdb数据库,包括两个表user和user_info,通过
<input name="height_s" type="text" id="height_s" size="4" maxlength="3">至<input name="height_e" type="text" id="height_e" size="4" maxlength="3">对height(身高)进行赋值,
查询数据库
sql="select * from user,user_info where user.user_name=user_info.user_name"
。
。
if Request("height_e")<>"" and Request("height_s")<>"" then
if height_s>height_e then
height_s=Request("height_e")
height_e=Request("height_s")
end if
sql=sql&" and height>='"& height_s &"'"
sql=sql&" and height<='"& height_e &"'"
end if
。
。
问题出来了:网页不提示错误,但没有附和条件的数据出现。
补充:1、height在user_info表中,其他查询字段在user表中。
2、如果height_s和height_s不填写数据,则能查询出数据。
采用的mdb数据库,包括两个表user和user_info,通过
<input name="height_s" type="text" id="height_s" size="4" maxlength="3">至<input name="height_e" type="text" id="height_e" size="4" maxlength="3">对height(身高)进行赋值,
查询数据库
sql="select * from user,user_info where user.user_name=user_info.user_name"
。
。
if Request("height_e")<>"" and Request("height_s")<>"" then
if height_s>height_e then
height_s=Request("height_e")
height_e=Request("height_s")
end if
sql=sql&" and height>='"& height_s &"'"
sql=sql&" and height<='"& height_e &"'"
end if
。
。
问题出来了:网页不提示错误,但没有附和条件的数据出现。
补充:1、height在user_info表中,其他查询字段在user表中。
2、如果height_s和height_s不填写数据,则能查询出数据。