求教 asp 分类搜索的问题!

来源:百度知道 编辑:UC知道 时间:2024/05/21 17:10:09
刚学asp不久,最近碰到了一个问题,没有办法实现分类搜索,求你们帮忙了。 很急!!!请直接帖出正解,谢谢啦~!!
是关于产品分类搜索的代码,表单代码如下:
<form action="products.asp" method="post" name="form1" id="form1">
<tr>
<td height="60"><div align="center">
<input style="BORDER-RIGHT: #cccccc 1px solid; BORDER-TOP: #cccccc 1px solid; BORDER-LEFT: #cccccc 1px solid; BORDER-BOTTOM: #cccccc 1px solid; HEIGHT: 16px" size="22" name="KeyWord" />
</div></td></tr>
<tr>
<td height="30">
<div align="center">
<select name="classid" id="classid" style="background-color: rgb();font-size: 9pt;border:1px double rgb(255,255,255);width:140px;height:14px" >
<%
set rs=server.createobject("adodb.recordset")
rs.open "select * from products_class where classid<>0 "

就那么一个字符,把你我害惨了! ^_^

你定义的变量是sqlwhere,但你程序中有个地方却是sqlwhere=sqlwher ???
就是下面这句:
if keyword<>"" then sqlwhere=sqlwher &" and itemno like '%"&keyword&"%'"

改成:
if keyword<>"" then sqlwhere=sqlwhere &" and itemno like '%"&keyword&"%'"

下次编程的时候要细心点咯~!~!~!

sclassid在FORM里的,你判断以下sclassid是否为空..