Unknown column 'appointment' in 'where clause'