Home > Backend Development > PHP Tutorial > 遇见过重复插入数据的请进

遇见过重复插入数据的请进

WBOY
Release: 2016-06-13 10:18:50
Original
1200 people have browsed it

遇见过重复插入数据的大虾请进!
问题是这样的,我用Php写了一个表单,然后在提交的处理页面执行一条insert语句,但是我到数据看的时候发现每次插入的都是两条记录,郁闷了一个下午了,希望遇见过这类问题的大侠能帮忙解决一下。我的提交表单的文件如下所示:



图书馆管理系统





 
 
 

 






 



 






 
 
当前位置:图书档案管理 > 添加图书信息 >>>


 
 



 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
条 形 码:
 
图书名称: *
图书类型:

作  者:
译  者:
出 版 社:

价  格: (元)
页  码:
书  架:
 
   






我的处理页面代码如下:session_start();
include("conn/conn.php");
$operator=$_SESSION[admin_name];
$barcode=$_POST[barcode];
$bookName=$_POST[bookName];
$typeid=$_POST[typeId];
$author=$_POST[author];
$translator=$_POST[translator];
$isbn=$_POST[isbn];
$price=$_POST[price];
$page=$_POST[page];
$bookcase=$_POST[bookcaseid];
$inTime=date("Y-m-d");
$sql=mysql_query("insert into tb_bookinfo(barcode,bookName,typeid,author,translator,ISBN,price,page,bookcase,inTime,operator )values('$barcode','$bookName','$typeid','$author','$translator','$isbn','$price','$page','$bookcase','$inTime','$operator')");
header('location:book.php');  
echo "";
?>


璋㈣阿
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