以下是我的 sql 查询,我在其中为 facility_id 分配来自 $fid 的值。请让我知道以下代码有什么问题,以便我可以相应地删除它们
$fid = 101;
$q = 'select r_present,r_reminder
from z_events
where resident_id = ?
and r_added > date_sub(curdate(), interval 37 day)
and fascility_id='."$fid". '
group by r_added
order by r_added
desc limit 4';