我是使用 mysqli 查询的新手。我正在尝试使用以下代码从多个表中删除一行:
$del_final = "DELETE confirm, coupon, cpn_image, c_token, deal_24
FROM confirm, coupon, cpn_image, c_token, deal_24
WHERE confirm.customer_id=?
AND coupon.customer_id=?
AND cpn_image.customer_id=?
AND c_token.customer_id=?
AND deal_24.customer_id=?";
if($stmt->prepare($del_final))
{
$stmt->bind_param('iiiii', $customer_id, $customer_id, $customer_id, $customer_id, $customer_id);
$OK3 = $stmt->execute();
$stmt->free_result();
}
似乎只有当每个表中有一行具有匹配的 customer_id 时才会删除。我是否误解了如何做到这一点?