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">
PHP怎么学习?PHP怎么入门?PHP在哪学?PHP怎么学才快?不用担心,这里为大家提供了PHP速学教程(入门到精通),有需要的小伙伴保存下载就能学习啦!
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号