Unknown column 'MAGIC' in 'where clause'