是不是不能在不同的表上同时执行插入和删除?或者我错过了什么
if(isset($_POST['update']))
{
$id = $_POST['delete_id'];
$name= $_POST['edit_name'];
$name2= $_POST['edit_name2'];
$pic = $_POST['edit_pic'];
$contactnumber = $_POST['edit_contact'];
$address = $_POST['edit_address'];
$details = $_POST['edit_details'];
$query = "INSERT INTO tabletest (name,name2,pic,contact,address,details,) VALUES ('$name' , '$name2' , '$pic' , '$contactnumber' , '$address' , '$details')";
$query .= "DELETE FROM tabletest2 WHERE id='$id'";
if (mysqli_multi_query($connection, $query))
{
$_SESSION['success'] = "Data Updated";
header('Location: blankpage.php');
}
else
{
$_SESSION['status'] = "Error, Please try again";
header('Location: blankpage.php');
}
}
慕哥9229398