id=request("id")
score=request.form("score")
id=split(id,",")
i=ubound(id)
score=split(score,",")
k=ubound(score)
for j=0 to i
if score(j) > 0 then
sql="insert into shiti(tmid,score) values(" & cint(id(j)) & "," & cint(score(j)) & ")"
conn.execute sql
end if
next
m = -1 for j = 0 to ubound(score) if cint(trim(score(j))) > 0 then m = m + 1 score(m) = score(j) end if next '注意, score本身个数并没有减少, 经上述处理后,不过是把score重定义了值. 你需要保证id个数与大于零的score个数总是相等.
for j=0 to i sql="insert into shiti(tmid,score) values(" & cint(id(j)) & "," & cint(score(j)) & ")" conn.execute sql next 这个问题第11个回答:
for each id in request("id") score=request.form("score"&id) sql="insert into shiti(tmid,score) values(" & cint(id) & "," & cint(score) & ")" conn.execute sql next