Unknown column 'turn' in 'where clause'