PHP执行Insert,产生2条重复记录,该如何解决

WBOY
Release: 2016-06-13 10:27:48
Original
1254 people have browsed it

PHP执行Insert,产生2条重复记录
如题。在页面中有多条sql语句,插入订单表没有重复记录,但是插入到记录表里就时不时的产生重复记录。有高手指点吗?

------解决方案--------------------
你是用GG浏览器在调试吗?
------解决方案--------------------
给表单加上ticket,借助SESSION防重复提交吧,能好点.
------解决方案--------------------
我看到的只有
$sqlstr5 = "INSERT INTO `online_saving_record`
(`online_saving_record_name`,`online_saving_record_money`,
`online_saving_record_golds`,`online_saving_record_time`,`into_member`)
values('$attach',$money,$amount,'$time','$arr1[into_member]')";//把记录写入充值记录表
能影响记录表,你贴出来的其他代码好像对问题没什么影响,因为你都是讲变量分别放入这2个表的,现在问题是如果订单表没有重复记录,肯定是没有重复提交表单,只有sql5给重复执行了 检查下你代码块中的IF语句 和‘}’,看有没有问题,不过就你提交的代码而言,真搞不懂哪出问题了

探讨
$sqlstr3 = "update `online_members` set `online_members_golds` = ".$sum."
where online_members_name = '".$attach."'"; //充值给玩家
$sqlstr6 = "update `online_adminstrator_sub` set `online_adminstrator_s……
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template