<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<% Response.Charset="gb2312" %>
<%
Dim A:A = "娃娃,毛绒娃娃,日本充气娃娃"
'obj为值,filed为字段名
Function sqlKeyWord(obj,field)
Dim temp:temp = split(obj,",")
For i = 0 To ubound(temp)
sqlKeyWord = sqlKeyWord & field&" like '%"&temp(i)&"%' or "
Next
sqlKeyWord = left(sqlKeyWord,len(sqlKeyWord)-3)
End Function
Dim
mysql:
mysql = "select top 3 sid,sname from product where " + sqlKeyWord(A,"keywords")
Response.Write(mysql)
'Set objRs = objConn.execute(mysql)
'Do while not objRs.Eof
'Response.Write(objRs("sname"))
'Loop
'objRs.close
'set objRs = nothing
'objConn.close
'set objConn = nothing
%>