求大神帮忙! 我想把一个循环写入数据库
<div style=" width:500px; height:300px; border:solid 1px #000000; float:left;"><form id="form2" name="form2" method="post" action="cnp_admin.asp">
<p>用户名:
<input type="text" name="username" />
</p>
<p>年份:
<select name="date1">
<option value="2016">2016</option>
<option value="2017">2017</option>
<option value="2018">2018</option>
<option value="2019">2019</option>
<option value="2020">2020</option>
</select>
</p>
<p>月份:
<select name="date2">
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
<option value="6">6</option>
<option value="7">7</option>
<option value="8">8</option>
<option value="9">9</option>
<option value="10">10</option>
<option value="11">11</option>
<option value="12">12</option>
</select>
</p>
<p>排班:
<label>
<input type="radio" name="Radio" value="day" />
白班</label>
<input type="radio" name="Radio" value="night" />
<label>夜班</label>
<input type="checkbox" name="cbox" value="cbox" />
2日开始</p>
<p>
<label></label>
<br />
<label></label>
<br />
</p>
<input type="submit" name="Submit2" value=" 提 交 " />
</form>
</div>
============================================================
<!--#include file="conn/conn.asp"-->
<%
'==============================
'数据库字段:username,year,month,work
'==============================
dim username,date1,date2,radio,cbox
set rs=server.CreateObject("ADODB.recordset")
sql="select * from Days"
rs.open sql,conn,1,3
rs.addnew
username=request.Form("username")
date1=request.Form("date1")
date2=request.Form("date2")
radio=request.Form("radio")
cbox=request.Form("cbox")
rs("username")=username
rs("year")=date1
rs("month")=date2
function yeartime(run)
if (run mod 4)<>0 then
yeartime=false
elseif (run mod 100)<>0 and (run mod 4)=0 then
yeartime=true
elseif (run mod 400)=0 then
yeartime=true
end if
end function
dim days
days=30
if yeartime(date2)=1 or 3 or 5 or 7 or 8 or 10 or 12 then
days=31
elseif yeartime(date2)=2 then
days=29
else
days=28
end if
if radio="night" then
for i=1 to days step 2
rs("work")=i&"日 夜班</br>"
next
elseif radio="night" and cbox="cbox" then
for i=2 to days step 2
rs("work")=i&"日 夜班</br>"
next
end if
rs.update
%>