假设文章标题字段为title,标签字段为tag 文章表为wz
<% dim kk3,key kk3=split(mywz("a_tag")," ") set xgwz=server.CreateObject("adodb.recordset") for i=0 to ubound(kk3) key=kk3(i) bsql=bsql & "artic.a_tag like '%"&key&"%' or " bsql=bsql & "artic.a_title like '%"&key&"%' or " next bsql=Left(bsql,(LEN(bsql)-3)) mysql=" SELECT top 12 * FROM artic WHERE ("&bsql&") order by a_id desc" xgwz.open mysql,coon,1,3 %>