<%
dim a,sql,rs,i
dim Topic,aTime,newsurl,classurl,flname,classname,menuname
i=1
sql="SELECT a_id as id, a_title,a_class1,a_time,""tbl1"" as tbl FROM [article] WHERE a_shenhe=1 and ("&newsword&") UNION select ask_id as id,ask_title as a_title ,"""" as a_class1,ask_time as a_time,""tbl2"" as tb1 from [jiankang_ask] where ask_shenhe=1 and ("&askword&") order by a_time desc"
'response.Write(sql)
set rs=Server.CreateObject("adodb.Recordset")
a=setPage(30,sql,conn,rs)
if rs.eof and rs.bof then
set rs2=conn.execute("Select * from [search] where keyword='"&spword&"'")
if rs2.eof then
conn.execute("INSERT INTO [search] (keyword,cishu,ip) VALUES ('"&spword&"',1,'"&Getip()&"')")
else
conn.execute("UPDATE [search] set cishu=cishu+1,ip='"&Getip()&"',shijian='"&now()&"' where keyword='"&spword&"'")
end if
Response.Write("
没有相关数据, 您可以直接点击后面的免费咨询!
")
end if
while not rs.eof and a(2)>0
Topic=rs("a_title")
For ii = 0 To UBound(sql_array)
Call BoldWord(Topic,sql_array(ii))
Next
aTime=FormatDateTime(rs("a_time"),2)
if rs("tbl")="tbl1" then
newsurl=""&rs("id")&".html"
set flname=conn.execute("select a_id,a_name,muluurl from [article_class] where a_id="&rs("a_class1")&"")
classname=flname("a_id")
menuname=flname("a_name")
classurl=flname("muluurl")
else
classurl="/ask/"
menuname="口臭问答"
newsurl="ask"&rs("id")&".html"
end if
Response.Write(vbcrlf&"
"&vbcrlf)
Response.Write("
"&vbcrlf)
Response.Write("
["&aTime&"]
"&vbcrlf)
Response.Write("
"&vbcrlf)
if i mod 5=0 then
response.write("
")
end if
i=i+1
rs.movenext
a(2)=a(2)-1
wend
rs.close
set rs=nothing
'Call pageBar4(a,"spword="&server.URLEncode(spword))
%>