跟随功能不起作用
public function matchingService() {
$stmt = mysqli_prepare($this->connection, "
INSERT INTO reusematching.matchedtable(user_idUser, productDetail_idProduct,Status,applyData)
SELECT waitinglist_user.user_idUser,
waitinglist_product.ProductDetail_idProduct,
productstatus,
waitinglist_user.waitinglistUser_applydata
FROM reusematching.waitinglist_user,
reusematching.waitinglist_product,
productinformation.productdetail,
productinformation.productstatus
where (waitinglistProduct_status = 1
and waitinglistUser_status = 1
and productCategroy_productCategroyID = waitinglistUser_applyProductType
and ProductDetail_idProduct = idProduct
and idStatus = waitinglistProduct_status);
SET SQL_SAFE_UPDATES=0;
DELETE FROM reusematching.waitinglist_user
WHERE Exists
(SELECT matchedtable.idMatchedTable
FROM reusematching.matchedtable
where matchedtable.user_iduser= waitinglist_user.user_idUser);
DELETE FROM reusematching.waitinglist_product
WHERE Exists
(SELECT matchedtable.idMatchedTable
FROM reusematching.matchedtable
where matchedtable.ProductDetail_idProduct
= waitinglist_product.ProductDetail_idProduct);
SET SQL_SAFE_UPDATES=1;
");
$this->throwExceptionOnError();
mysqli_stmt_execute($stmt);
$this->throwExceptionOnError();
mysqli_stmt_free_result($stmt);
mysqli_close($this->connection);
return null;
}
显示的弹性
服务器错误 MySQL 错误 - 1064:您的 SQL 语法有错误;检查与您的 MySQL 服务器版本相对应的手册,以在第 18 行的 'DELETE FROM reusematching.waitinglist_user WHERE Exists (SELECT matche' 附近使用正确的语法
为什么我有这个错误?以及如何调试它。