更新时间:2023-02-04 08:39:17
对于每个查询,您要两次调用mysqli_query.
You're calling mysqli_query twice for each query.
第二次调用它实际上是在传递资源作为查询参数,这会导致您得到错误.
The second time you call it you're actually passing a resource as the query parameter, which causes the error you're getting.
尝试将您的代码更改为此:
Try changing your code to this:
<?php
$con=mysqli_connect("localhost","root","MYPASS","repair");
$ID = $_REQUEST['ID'];
$sql = "DELETE FROM tblreparation WHERE ID = {$ID}";
if (!mysqli_query($con,$sql)) {
die('Error: ' . mysqli_error($con));
}
$sql = "DELETE FROM tblrepstat WHERE repID = {$ID}";
if (!mysqli_query($con,$sql)) {
die('Error2: ' . mysqli_error($con));
}
echo "1 record deleted";
mysqli_close($con);
?>