
<%
dim conn
dim connstr
on error resume next
connstr="DBQ="+server.mappath("/intonet_data/idee_solarrain_data.asp")+";DefaultDir=;DRIVER={Microsoft Access Driver (*.mdb)};"
set conn=server.createobject("ADODB.CONNECTION")
conn.open connstr
sql = "select product_id,product_name from products where sign='meizi' order by update_date,update_time desc"
Set rs= Server.CreateObject("ADODB.Recordset")
rs.open sql,conn,1,1
if rs.eof and rs.bof then
response.write " 目前没有商品
"
else
%>
<% do while not rs.eof
pid=rs("product_id")
%>
<%
if Cint(productid)=CInt(pid) then
%>
■ |
<% response.write rs("product_name")
%>
|
<% else
%>
■ |
<% response.write rs("product_name")
%>
|
<% end if
%>
<% rs.movenext
loop
%>
<% rs.close
end if
set rs=nothing
%>
|
<%
sql = "select * from products where product_id=" & product_id
' response.write sql
Set rs= Server.CreateObject("ADODB.Recordset")
rs.open sql,conn,1,1
if rs.eof and rs.bof then
response.write " 没有此商品
"
else
%>
 |
真诚的祝福
|
<%
'------------------------------------------------------------------------------------------
'显示用户评分及评论
Set rs= Server.CreateObject("ADODB.Recordset")
sql="select count(*) from comments where product_id=" & product_id
RS.Open sql,conn
mycount=rs(0)
rs.close
set rs=nothing
Set rs= Server.CreateObject("ADODB.Recordset")
sql="select avg(d_vote),avg(f_vote),avg(ui_vote),avg(fp_vote) from comments where product_id=" & product_id
RS.Open sql,conn
mark=Cint((rs(0)+rs(1)+rs(2)+rs(3))/4)
d_vote=rs(0)
f_vote=rs(1)
ui_vote=rs(2)
fp_vote=rs(3)
rs.close
set rs=nothing
%>
用户评分:
<% =mark %>
评分人次:
<% =mycount %>
<%
Set rs= Server.CreateObject("ADODB.Recordset")
sql="select top 4 * from comments where product_id=" & product_id & " order by comment_id desc"
RS.Open sql,conn,1,1
if rs.eof and rs.bof then
%>
还没有用户评论 |
<% else
do while not rs.eof
%>
·
<% if Len(rs("comment"))>18 then
response.write Left(rs("comment"), 18) & "..." &"[" & rs("username") & "]"
else
response.write rs("comment")&"[" & rs("username") & "]"
end if
%>
|
<% rs.movenext
loop
%>
<% end if
rs.close
set rs=nothing
'-------------------------------------------------------------------------------------------
%>
|