ASP 通过关键字匹配相关文章 数据库查询相关文章(split)
<% dim kk3,key kk3=split(rslist("N_keywords"),",") set rskeywords=server.CreateObject("adodb.recordset") for i=0 to ubound(kk3) key=kk3(i) bsql=bsql & "N_keywords like '%"&key&"%' or " next bsql=Left(bsql,(LEN(bsql)-3)) mysql=" SELECT top 12 * FROM Article_News WHERE ("&bsql&") order by N_id desc" rskeywords.open mysql,conn,1,3 do while not rskeywords.eof response.Write(rskeywords("N_title")) response.Write("</br>") rskeywords.movenext loop rskeywords.close set rskeywords=nothing %>
|