| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 679 人关注过本帖
标题:奇怪的现象
只看楼主 加入收藏
eournet
Rank: 2
等 级:论坛游民
帖 子:103
专家分:26
注 册:2010-5-22
结帖率:55.56%
收藏
 问题点数:0 回复次数:3 
奇怪的现象
代码运行没有报错,但是每次写入数据库的时候会在末尾写进38条空数据,请教高手看下代码,哪里有问题
<%
if request("hid1")="ok" then
nowselldate=request("selldate")
nowenddate=request("enddate")
nowbeizhu=request("beizhu")
nowprice=request("price")
nowbzr=request("bzr")
nowtype=request("type")
nowid_danwei=request("id_danwei")
nowid_produit=request("id_produit")
nowid_huiyuan=request("id_huiyuan")
nowid_login=request("id_login")
set rs_login=conn.execute("select * from login where id="&nowid_login)
nowid_ku=request("id_ku")
set rs_ku=conn.execute("select * from ku where id="&nowid_ku)
nowid_gys=request("id_gys")
nowgys=request("gys")
nowjxf=request("jxf")
nowybf=request("ybf")
nowgrxs=request("grxs")
nowfcf=request("fcf")
nowaqf=request("aqf")
nowgj=request("gj")
nowbianhao=replace(replace(replace(replace(replace(replace(FormatDateTime(now(),0),":","")," ",""),"-",""),"/",""),"上午",""),"下午","")
'totalshulian=0
if nowprice2="" then
  nowprice2=0
end if
if nowprice1="" then
  nowprice1=0
end if
if nowshulian="" then
  nowshulian=0
end if
for x=1 to maxproduit
nowhuohao=request("huohao"&x)
nowtitle=request("title"&x)
nowshulian=request("shulian"&x)
nowid_danwei=request("id_danwei"&x)
nowprice2=request("price2"&x)
nowprice1=request("price1"&x)
nowbigclass=request("bigclass"&x)
if nowprice2="" then
  nowprice2=0
end if
if nowprice1="" then
  nowprice1=0
end if
if nowshulian="" then
  nowshulian=0
end if
set rs=server.createobject("ADODB.RecordSet")
sql="select * from b3j where 1=2"
rs.open sql,conn,1,3
rs.addnew
rs("huohao")=nowhuohao
rs("title")=nowtitle
rs("shulian") =nowshulian
rs("id_danwei")=nowid_danwei
rs("price1")=nowprice1
rs("price2")=nowprice2
rs("bigclass")=nowbigclass
rs("id_gys")=nowid_gys
rs("id_produit")=nowid_produit
rs("id_huiyuan")=nowid_huiyuan
rs("price")=nowprice
rs("id_ku")=nowid_ku
rs("bzr")=nowbzr
rs("gys")=nowgys
rs("type")=nowtype
rs("selldate")=nowselldate
rs("enddate")=nowenddate
rs("id_login")=nowid_login
rs("login")=rs_login("username")
rs("bianhao")=nowbianhao
rs("beizhu")=nowbeizhu
rs("ybf")=nowybf
rs("jxf")=nowjxf
rs("grxs")=nowgrxs
rs("fcf")=nowfcf
rs("aqf")=nowaqf
rs("gj")=nowgj
rs("jggr")= nowprice1*nowshulian
rs("pggr")= nowprice2*nowshulian
rs.update
next

%>
搜索更多相关主题的帖子: request 数据库 price where 
2013-09-24 20:51
eournet
Rank: 2
等 级:论坛游民
帖 子:103
专家分:26
注 册:2010-5-22
收藏
得分:0 
已解决,缺了if   end
2013-09-24 22:11
303770957
Rank: 11Rank: 11Rank: 11Rank: 11
等 级:小飞侠
威 望:6
帖 子:838
专家分:2125
注 册:2005-9-10
收藏
得分:0 
你真聰明!

♂ 死后定当长眠,生前何须久睡。♀
2013-09-24 23:27
eournet
Rank: 2
等 级:论坛游民
帖 子:103
专家分:26
注 册:2010-5-22
收藏
得分:0 
谢谢美女夸奖
2013-09-25 20:18
快速回复:奇怪的现象
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.014977 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved