SELECT attendance_id , schedule_title, schedule_s_date, schedule_e_date, tbl_attendance.schedule_id, attendance_schedule, observe_a, observe_b, comment, attendance, attorney FROM tbl_schedule left outer join tbl_attendance on tbl_attendance.schedule_id = tbl_schedule.schedule_id WHERE tbl_attendance.member_id = AND (tbl_schedule.attendance = 1 OR tbl_schedule.attorney = 1) ORDER BY schedule_s_date DESC [nativecode=ERROR: syntax error at or near "AND" at character 641]