为什么我更新数据的某一列,其他的所有的数据都被删除了

找找乐儿 2009-07-30 07:02:33
我做了一个后台界面,里面做了很多表单,每一个表单用来更新表中的某一列,每个的提交按钮都是分离的,但为什么我一更新其中某一列,其他列的数据都被删除了。
程序如下所示:
<form action="" method="post" name="form26" id="form26" >
<p>输入更新内容</p>
<p>  </p>
<label>
<input type="text" name="cont26">
</label>
<p>
<label>
<input type="submit" name="Submit35" value="提交">
</label>
</p>
</form>
<span style="font-size: 16px">
<%
cont=request.Form("cont26")
sql= "update ad set mtop='"&cont&"' where ID =1 "
rs.open sql,conn,1,3
%>
</span></td>
<td width="190" height="100" bordercolor="#000000"><form action="" method="post" name="form27" id="form27" >
<p>输入更新内容</p>
<p>  </p>
<label>
<input type="text" name="cont27">
</label>
<p>
<label>
<input type="submit" name="Submit36" value="提交">
</label>
</p>
</form>
<span style="font-size: 16px">
<%
cont=request.Form("cont27")
sql= "update ad set btop='"&cont&"' where ID =1 "
rs.open sql,conn,1,3
%>
</span></td>
<td width="190" height="100" bordercolor="#000000"><form action="" method="post" name="form28" id="form28">
<p>输入更新内容</p>
<p>  </p>
<label>
<input type="text" name="cont28">
</label>
<p>
<label>
<input type="submit" name="Submit37" value="提交">
</label>
</p>
</form>
<span style="font-size: 16px">
<%
cont=request.Form("cont28")
sql= "update ad set stop='"&cont&"' where ID =1 "
rs.open sql,conn,1,3
%>

为什么会出现这种问题?急急急
...全文
82 4 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
toury 2009-07-31
  • 打赏
  • 举报
回复
楼主还在吗?才发现我代码写的多余了,LOOK:
<%
flag=request.QueryString("flag")
if flag<>"" then
cont=request.Form("cont"&flag)
select case flag
case 26: sql= "update ad set mtop='"&cont&"' where ID =1 "
case 27: sql= "update ad set mtop='"&cont&"' where ID =1 "
case 28: sql= "update ad set mtop='"&cont&"' where ID =1 "
end select
if sql<>"" then conn.execute(sql)

'这样就可以了
sql= "update ad set mtop='"&cont&"' where ID =1 "
conn.execute(sql)
end if
%>
toury 2009-07-30
  • 打赏
  • 举报
回复

把3处这样的代码中的颜色代码去掉!!我本想标明改动的地方,但放代码引用里颜色无效反倒添乱了
<form action="?flag=26" method="post" name="form26" id="form26" >


<form action="?flag=26" method="post" name="form26" id="form26" >
<form action="?flag=27" method="post" name="form27" id="form27" >
<form action="?flag=28" method="post" name="form28" id="form28">
toury 2009-07-30
  • 打赏
  • 举报
回复

<%
flag=request.QueryString("flag")
if flag<>"" then
cont=request.Form("cont"&flag)
select case flag
case 26: sql= "update ad set mtop='"&cont&"' where ID =1 "
case 27: sql= "update ad set mtop='"&cont&"' where ID =1 "
case 28: sql= "update ad set mtop='"&cont&"' where ID =1 "
end select
if sql<>"" then conn.execute(sql)
end if
%>
<form action="?flag=26" method="post" name="form26" id="form26" >
<p>输入更新内容 </p><p>  </p>
<label><input type="text" name="cont26"></label>
<p><label><input type="submit" name="Submit35" value="提交"></label></p>
</form>

<span style="font-size: 16px"></span>
</td>
<td width="190" height="100" bordercolor="#000000">
<form action="?flag=27" method="post" name="form27" id="form27" >
<p>输入更新内容 </p><p>  </p>
<label><input type="text" name="cont27"></label>
<p><label><input type="submit" name="Submit36" value="提交"></label></p>
</form>
<span style="font-size: 16px"></span>
</td>

<td width="190" height="100" bordercolor="#000000">
<form action="?flag=28" method="post" name="form28" id="form28">
<p>输入更新内容 </p><p>  </p>
<label><input type="text" name="cont28"></label>
<p><label><input type="submit" name="Submit37" value="提交"></label></p>
</form>

找找乐儿 2009-07-30
  • 打赏
  • 举报
回复
上面是三个表单,提交某一个表单时,好像其他被关联了,不知道是怎么回事
访问真八字排盘系统介绍: 1、八字排盘 八字排盘是将年月日时按照天干地支的形式进行排列,一个时间单位代表了一个柱。八字由年柱、月柱、日柱和时柱共四个柱组成,也被称为四柱八字。八字学中基于中国阴阳五行、天干地支与刑冲克害、以及民间盲派的神煞论等方式,进一步预测爱情顺遂、工作高低、姻缘好坏、财富高低、学业成就、身体健康等事的学问。 八字排盘由以下元素组合:年月日时四柱、大运干支、胎元 、流年干支、十神、地势、神煞等。生辰八字不只是把干支历计算出来,而还要遵守月令、节令的强弱,时辰的阴阳变化进行校正。排盘分析,就是根据出生者的性别、天干地支的阴阳五行关系、进一步推算出来的一套方法论,给预测者做人生吉凶的参考数据,在未来事业、财运、婚姻、家庭等问题时,能做出风险较低的决策。 八字排盘怎么看 八字排盘由年、月、日、时四柱组成,每柱包含一个天干和一个地支,共八个字。年柱代表出生的年份,月柱代表出生的月份,日柱代表出生的日期,时柱则代表出生的时辰。每个柱的干支组合都会对个人的命运产生影响。天干地支旁边标注的正财、偏财、偏印、正印、比肩、劫财、食神、伤官、正官、七杀等,称为十神。 2、八字排盘软件介绍 我们是腾讯云市场金牌合作伙伴,广州正规软件开发公司,开发的八字排盘系统数据最全面精准,我们八字排盘采用最精确的排盘程序,而且运用“真太阳时”,进行更精确的时间划分。大家都知道我们使用的北京时间,是统一规定的标准时间。而八字排盘需要相对于太阳方位的天文时间,即平太阳时。我们国家地大物博,北京时间19时,哈尔滨已经夜幕降临,而新疆却还是太阳高挂,这时哈尔滨的天文时间可能在20:00以后,而新疆的天文时间可能在16时以前。北京时间是东经120度经线的平太阳时,如果您出生地的经度与北京时间所处的经度差异较大,或者处于单数时间点的前后,比如6点差一刻,8点,10点15分等

28,409

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧