Unknown column 'p.mes' in 'where clause'