Rumah > Artikel > pembangunan bahagian belakang > PHP!在一个php文件中怎么执行两个不同的insert语句
PHP求助!在一个php文件中如何执行两个不同的insert语句?
<?php <br /> session_start();<br /> include("Conn/conn.php");<br /> <br /> $ISBN=$_POST["ISBN"];<br /> $B_Name=$_POST["bookName"];<br /> $B_Author=$_POST["B_Author"];<br /> $B_Pub=$_POST["B_Pub"];<br /> $B_Author=$_POST["B_Author"];<br /> $B_BuyTime=date("Y-m-d");<br /> <br /> $B_Num=$_POST["B_Num"];<br /> $Content=$_POST["content"];<br /> echo $B_Num."<br>";//测试输出语句<br /> echo $Content;//测试输出语句<br /> $sql1=mysql_query("insert into book1(ISBN,B_Name,B_Author,B_Pub,B_BuyTime)values('$ISBN','$B_Name','$B_Author','$B_Pub','$B_BuyTime')");<br /> <br /> $sql2=mysql_query("insert into book2(B_Num,ISBN,Borrowed,Ordered,Introduction)values('$B_Num','$ISBN','否','否','$Content')");<br /> <br /> echo "<script language='javascript'>alert('图书信息添加成功!');history.back();location.href='book.php';</script>";<br /> ?><br /> <meta http-equiv="Content-Type" content="text/html; charset=gb2312">