该楼层疑似违规已被系统折叠 隐藏此楼查看此楼
下面是部分PHP代码,我需要在删除数据后插入多条数据,每条数据中都有student_number,问题好像出在数据删除之后,每次插入一条信息,他就删掉了,最后只剩一条数据了,请大神们帮我看一下
if ( isset($_POST['student_number']) && isset($_POST['book'])&&isset($_POST['author']) &&isset($_POST['borrow_date']) &&
isset($_POST['return_date']) && isset($_POST['location']) && isset($_POST['tiaomahao']) ) {
$student_number=$_POST["student_number"];
$book=$_POST["book"];
$author= $_POST['author'];
$borrow_date=$_POST["borrow_date"];
$return_date=$_POST["return_date"];
$location = $_POST['location'];
$tiaomahao = $_POST['tiaomahao'];
$sql="delete from libraryinfor where student_number ='$student_number'";
$result=mysql_query($sql);
// include db connect class
require_once __DIR__ . '/db_connect.php';
// connecting to db
$db = new DB_CONNECT();
// mysql inserting a new row
$result = mysql_query("INSERT INTO libraryinfor(student_number,book,author,borrow_date,return_date,location,tiaomahao)
VALUES( '$student_number', '$book', '$author','$borrow_date', '$return_date','$location','$tiaomahao')");