问题描述
</head><body><hralign="right"width="100%"size="0"noshade="noshade"/><tablewidth="977"border="1"><tr><tdwidth="361"><formaction="/sopc.asp"method="get"name="add"><selectname="title"id="title"style="width:100px;height:18px;"><optionvalue=""selected="selected"name="title">选择拼车方式</option><optionvalue="上下班拼车"name="title">上下班拼车</option><optionvalue="临时拼车"name="title">临时拼车</option><optionvalue="周末拼车"name="title">周末拼车</option><optionvalue="城际拼车"name="title">城际拼车</option><optionvalue="旅游拼车"name="title">旅游拼车</option><optionvalue="节假日拼车"name="title">节假日拼车</option><optionvalue="长途拼车"name="title">长途拼车</option><optionvalue="其它拼车"name="title">其它拼车</option></select><selectname="titlee"id="titlee"style="width:60px;height:18px;"><optionvalue="车主"selected="selected">车主</option><optionvalue="乘客">乘客</option></select></br>出发点:<selectname="province"value="四川省"></select><selectname="city"></select><selectname="area"></select><inputname="chufadi"type="text"value=""size="20"/></br>到达地:<selectname="province1"value="四川省"></select><selectname="city1"></select><selectname="area1"></select><inputname="daodadi"type="text"value=""size="20"/><inputtype="submit"name="button"id="button"value="搜索"/></form><scriptlanguage="javascript"defer>newPCAS("province","city","area");newPCAS("province1","city1","area1");</script></td></tr></table><tablewidth="980"border="0"align="center"cellpadding="0"cellspacing="0"><tr><tdvalign="top"><divclass="right_title">站内搜索</div><divclass="right_body"><%title=request.QueryString("title")titlee=request.QueryString("titlee")province=request.QueryString("province")city=request.QueryString("city")area=request.QueryString("area")chufadi=request.QueryString("chufadi")province1=request.QueryString("province1")city1=request.QueryString("city1")area1=request.QueryString("area1")daodadi=request.QueryString("daodadi")iftitle=""thenResponse.Write("")Response.End()endifsetrs=server.createobject("adodb.recordset")exec="select*from[aa]wheretitle='"&title&"'ortitlee='"&titlee&"'orbiglocation='"&province&"'orsmalllocation='"&city&"'ordlmc0='"&area&"'orchufadi='"&chufadi&"'orbiglocation='"&province1&"'orsmalllocation='"&city1&"'ordlmc0='"&area1&"'orchufadi='"&daodadi&"'orderbytitledesc"rs.openexec,conn,1,1ifrs.eofthenresponse.Write" 没有搜索到相关内容!"elsers.PageSize=10'每页记录条数iCount=rs.RecordCount'记录总数iPageSize=rs.PageSizemaxpage=rs.PageCountpage=request("page")ifNotIsNumeric(page)orpage=""thenpage=1elsepage=cint(page)endififpage<1thenpage=1elseifpage>maxpagethenpage=maxpageendifrs.AbsolutePage=Pageifpage=maxpagethenx=iCount-(maxpage-1)*iPageSizeelsex=iPageSizeendifFori=1Tox%><%ift=1then%>谁能帮我看下这个查询功能不听我的使唤选好查出来的是全部信息
解决方案
本帖最后由 wutengchu 于 2011-11-08 17:16:54 编辑
解决方案二:
你这个搜索肯定不会听你使唤你全都用OR来判断的空值默认搜出来的就是全部的如果有一个空值就会全显示出来了
解决方案三:
最好根据你接受的条件通过判断来拼接sql