初学者提出的一个简单问题(关于投票器)
<%
db="/count.mdb"
connstr="DBQ="+server.mappath(""&db&"")+";DefaultDir=;DRIVER={Microsoft Access Driver (*.mdb)};"
set conn=server.createobject("ADODB.CONNECTION")
strsql = "update tp set ps=ps+1 where question = '"&request("elect")&"'"
conn.execte(strsql)
response.write("投票成功")
conn.close()
%>
<body>
<form method="post" action="" name=myform>
<table align="center" width="100">
<p align="center">
<tr>
<td nowrap width="100" 50% "">
<input type="radio" name="elect" value="1" /> 机械工业</td>
</tr>
<tr>
<td nowrap width="100" 50% "">
<input type="radio" name="elect" value="1" /> 化学工业</td></tr>
<tr>
<td nowrap width="100" 50% "">
<input type="radio" name="elect" value="1" /> 电子工业</td></tr>
<tr>
<td nowrap width="100" 50% "">
<input type="radio" name="elect" value="1" /> 建筑工业</td>
</tr>
</p>
</table>
<%
if request.QueryString("action")="submit" then
result=request.form("elect")
response.write result
%>
<%end if%>
<p align="center">
<input type="submit" value="提交" name="submit" />
<input type="reset" value="取消" name="reset" />
</p>
</form>
<%
result=split((trim(request.form("elect")),",")
for i=0 to ubound(result)
conn.execute("update tp set tp_count=tp_count+1 where question='"&request("elect")&"' ")
%>
</body>
表TP
表结构为:
id 自动编号 编号
question 文本 投票名
TP 数字 票数
哪位大虾帮我看看,本人刚接触ASP,这个投票器导入数据库程序对吗? 拜托了,在线等