毕业设计求助 如何把数据提交到数据库
各位大神、老师、学长,小弟毕业设计是做一个餐厅在线订座系统如图
现在遇到一个问题,就是从数据库提取出来能订的座位后,用户订座后,这个数据又怎样提交给后台数据库?
程序代码:
<form id="form1" name="form1" action="3.asp" method="post"> <% connstr="provider=microsoft.jet.oledb.4.0;data source="&server.MapPath("db1.mdb") set conn=server.CreateObject("adodb.connection") conn.open connstr strsql="select * from t1" set rs=server.CreateObject("adodb.recordset") rs.open strsql,conn,1,1 do while not rs.eof zt="" if rs("zt")=1 then zt="disabled" end if %> <input type="checkbox" name="c1" id="01" value='<%=rs("n1")%>' <%=zt%>/><%=rs("n1")%>号桌 <% rs.movenext loop %><br /> <input type="submit" name="button" id="button" value="订座" _________________________________________________________________________________________________________________________________这是前台 <form id="form1" name="form1" method="post" action="5.asp" > <%connstr="provider=microsoft.jet.oledb.4.0;data source="&server.MapPath("db1.mdb") set conn=server.CreateObject("adodb.connection") conn.open connstr strsql="select * from T1" %> <% if request.form("c1")<>""then u1=request.Form("c1") response.write("您选择了"&u1&"桌,是否确认订座?")&"</br>" set rs=server.CreateObject("adodb.recordset") rs.open strsql,conn,2,2 strsql="select * from t1 where n1="&u1 rs("zt")=trim("1") end if if request.form("c2")<>""then u1=request.Form("c2") response.write ("您选择了"&u1&"桌,是否确认订座?")&"</br>" set rs=server.CreateObject("adodb.recordset") rs.open strsql,conn,2,2 strsql="select * from t1 where n1="&u1 rs("zt")=trim("1") end if if request.form("c3")<>""then u1=request.Form("c3") response.write("您选择了"&u1&"桌,是否确认订座?")&"</br>" set rs=server.CreateObject("adodb.recordset") rs.open strsql,conn,2,2 strsql="select * from t1 where n1="&u1 rs("zt")=trim("1") end if if request.form("c4")<>""then u1=request.Form("c4") response.write("您选择了"&u1&"桌,是否确认订座?")&"</br>" set rs=server.CreateObject("adodb.recordset") rs.open strsql,conn,2,2 strsql="select * from t1 where n1="&u1 rs("zt")=trim("1") end if if request.form("c5")<>""then u1=request.Form("c5") response.write("您选择了"&u1&"桌,是否确认订座?")&"</br>" set rs=server.CreateObject("adodb.recordset") rs.open strsql,conn,2,2 strsql="select * from t1 where n1="&u1 rs("zt")=trim("1") end if if request.form("c6")<>""then u1=request.Form("c6") response.write("您选择了"&u1&"桌,是否确认订座?")&"</br>" set rs=server.CreateObject("adodb.recordset") rs.open strsql,conn,2,2 strsql="select * from t1 where n1="&u1 rs("zt")=trim("1") end if if request.form("c7")<>""then u1=request.Form("c7") response.write("您选择了"&u1&"桌,是否确认订座?")&"</br>" set rs=server.CreateObject("adodb.recordset") rs.open strsql,conn,2,2 strsql="select * from t1 where n1="&u1 rs("zt")=trim("1") end if if request.form("c8")<>""then u1=request.Form("c8") response.write("您选择了"&u1&"桌,是否确认订座?")&"</br>" set rs=server.CreateObject("adodb.recordset") rs.open strsql,conn,2,2 strsql="select * from t1 where n1="&u1 rs("zt")=trim("1") end if if request.form("c9")<>""then u1=request.Form("c9") response.write("您选择了"&u1&"桌,是否确认订座?")&"</br>" set rs=server.CreateObject("adodb.recordset") rs.open strsql,conn,2,2 strsql="select * from t1 where n1="&u1 rs("zt")=trim("1") end if if request.form("c10")<>""then u1=request.Form("c10") response.write("您选择了"&u1&"桌,是否确认订座?")&"</br>" set rs=server.CreateObject("adodb.recordset") rs.open strsql,conn,2,2 strsql="select * from t1 where n1="&u1 rs("zt")=trim("1") end if %> <% rs.update rs.close set rs=nothing conn.close set conn=nothing %> <input type="submit" name="button" id="button" value="提交" /> <input type="button" name="b2" id="button2" value="返回"; onclick="location.href='zi.asp'"/> </form> -------------------------------------------------------------------------------------------------------------------------------------------这是确认提交页面,提交到5.asp,5.asp是空的,怎么实现?
这是数据库,n1代表座位数 zt代表有人或无人 有人显示1 无人显示0