Unknown column 'num' in 'where clause'