我创建了这段代码,但它似乎不起作用。在 where 子句 paymentnotification.subpayment 和 collections.status 中是否正确
$sql = "SELECT collections.categoryid,collections.handler,collections.status,paymentnotification.categoryid,paymentnotification.amount,paymentnotification.payee,paymentnotification.paymentdate
FROM collections
INNER JOIN paymentnotification
ON paymentnotification.month=collections.month AND paymentnotification.categoryid=collections.categoryid
WHERE paymentnotification.subpayment=? AND collections.status=? AND collections.year=? BETWEEN ? AND ?";
$p = $conn->prepare($sql);
$p->execute(array($payment,$status,$year,$monthc,$monthc2));