Query failed error#1064 : You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'AND stat.status=2 AND stat.form=8 AND online=1 ORDER BY stat.reg_date DESC' at line 4(SELECT fac.* FROM frame_request_facility8 fac, frame_request_facility_status stat WHERE fac.round = stat.round AND fac.userId = stat.userId AND fac.round= AND stat.status=2 AND stat.form=8 AND online=1 ORDER BY stat.reg_date DESC)