修改一小段asp

来源:百度知道 编辑:UC知道 时间:2024/06/07 05:49:33
我有下面一段代码,我的要求很简单,我想加一个查询是ProductName+Producer这两个字段的模糊查询也就是通用名+厂家的查询该怎么改?谢谢了!
<td nowrap="nowrap"> 搜索关键字:
<input type="hidden" name="act" value="search">
<input type="text" name="txtitle" size="25" style="font-size: 9pt" value="<%=txtitle%>">  
<select style="font-size: 9pt" name="search">

<option value="1" selected>按通用名查询</option>
<option value="2" <%if request("search")=2 then %>selected<%end if%>>按商品名查询</option>
<option value="3" <%if request("search")=3 then %>selected<%end if%>>按生产商查询</option>
</select>
<input name="提交" type="button" value="查询" align="absmiddle" onClick="ch

<!--#include file="conn.asp"-->
<%
sql88="select * from t_gahao where "

if trim(request("name"))<>"" then
sql88= sql88 & "names like '%"&trim(request("name"))&"%' and "
end if

if trim(request("phone"))<>"" then
sql88= sql88 & "phone like '%"&trim(request("phone"))&"%' and "
end if

if trim(request("time"))<>"" then
sql88= sql88 & "yytime like '%"&trim(request("time"))&"%' and "
end if

if trim(request("gjc"))<>"" then
sql88= sql88 & "guanjianchi like '%"&trim(request("gjc"))&"%' and "
end if

sql88= sql88 & " 1=1 order by id desc"

set rs88=server.createobject("ad