Following is my sql query in which to facility_id i wat to assign value that comes from $fid. Kindly let me know what is wrong with the following code so i can remove them accordingly
$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';
Kindly try this: