亚洲乱码中文字幕综合,中国熟女仑乱hd,亚洲精品乱拍国产一区二区三区,一本大道卡一卡二卡三乱码全集资源,又粗又黄又硬又爽的免费视频

ASP 相關(guān)文章或者相關(guān)產(chǎn)品

 更新時(shí)間:2009年05月29日 20:28:15   作者:  
以下僅提供相關(guān)思路和關(guān)鍵代碼,并且只提供一種最簡(jiǎn)單的算法實(shí)現(xiàn),稍復(fù)雜的本文不做介紹。
在后臺(tái)添加中一般我們都設(shè)置了一個(gè)“關(guān)鍵字”,而且一般輸入可能如下:
娃娃,毛絨娃娃,日本充氣娃娃
我們將根據(jù)這個(gè)來做,具體實(shí)現(xiàn)如下:
先看一條SQL語句:
復(fù)制代碼 代碼如下:

select top 3 sid,sname from product where keywords like '%娃娃%' or keywords like '%毛絨娃娃%' or keywords like '%日本充氣娃娃%'

那么我們根據(jù)這條語句就可以搜索到相關(guān)產(chǎn)品或者相關(guān)文章了(其實(shí)有更復(fù)雜以及更好的實(shí)現(xiàn),但這里暫時(shí)不提及了),以下是關(guān)鍵代碼:
復(fù)制代碼 代碼如下:

<%@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
%>

相關(guān)文章

最新評(píng)論