Unknown column 'switch' in 'where clause'