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

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

Jun 13, 2016 am 10:27 AM
online quot record

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……
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

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Black Myth: Wukong smashes the competition with 2.2 million Steam players mere hours after launch Black Myth: Wukong smashes the competition with 2.2 million Steam players mere hours after launch Aug 21, 2024 am 10:25 AM

The hype for Black Myth: Wukong has been felt globally as the game slowly crawled towards its launch date, and it didn't disappoint when it launched on August 20, having received a very warm welcome from the gaming community at large. After being onl

php提交表单通过后,弹出的对话框怎样在当前页弹出,该如何解决 php提交表单通过后,弹出的对话框怎样在当前页弹出,该如何解决 Jun 13, 2016 am 10:23 AM

php提交表单通过后,弹出的对话框怎样在当前页弹出php提交表单通过后,弹出的对话框怎样在当前页弹出而不是在空白页弹出?想实现这样的效果:而不是空白页弹出:------解决方案--------------------如果你的验证用PHP在后端,那么就用Ajax;仅供参考:HTML code

YouTubers build 2-meter iPhone and break two world records YouTubers build 2-meter iPhone and break two world records Sep 09, 2024 pm 09:30 PM

On September 6, 2024, YouTubers Matthew Perkins, known as DIY Perks, and Arun Maini, aka MrWhoseTheBoss, broke an insane record: they built the world's largest, fully functional iPhone 15 Pro Max. The gigantic smartphone measures 2.02 meters and weig

不用数据库来实现用户的简单的下载,代码如下,但是却不能下载,请高手找下原因,文件路劲什么的没有关问题 不用数据库来实现用户的简单的下载,代码如下,但是却不能下载,请高手找下原因,文件路劲什么的没有关问题 Jun 13, 2016 am 10:15 AM

不用数据库来实现用户的简单的下载,代码如下,但是却不能下载,请高手找下原因,文件路劲什么的没问题。

图片消失怎么解决 图片消失怎么解决 Apr 07, 2024 pm 03:02 PM

图片消失如何解决先是图片文件上传$file=$_FILES['userfile'];  if(is_uploaded_file($file['tmp_name'])){$query=mysql_query("INSERT INTO gdb_banner(image_src ) VALUES ('images/{$file['name'

Valve issues GTA V refunds after anti-cheat strands Steam Deck gamers Valve issues GTA V refunds after anti-cheat strands Steam Deck gamers Sep 20, 2024 pm 06:18 PM

Rockstar Games recently added BattleEye anti-cheat to Grand Theft Auto V, seemingly deliberately breaking Linux support in the process, leaving Steam Deck owners out in the cold, and placing the blame for Steam Deck incompatibility squarely on the sh

图片消失怎么解决 图片消失怎么解决 Jun 13, 2016 am 10:09 AM

图片消失如何解决先是图片文件上传$file=$_FILES['userfile'];  if(is_uploaded_file($file['tmp_name'])){$query=mysql_query("INSERT INTO gdb_banner(image_src ) VALUES ('images/{$file['name'

为什么小弟我在php上写的这个代码,在浏览器上什么都不显示 为什么小弟我在php上写的这个代码,在浏览器上什么都不显示 Jun 13, 2016 am 10:24 AM

为什么我在php上写的这个代码,在浏览器上什么都不显示啊

See all articles