Unknown column 'contacto' in 'where clause': SELECT * FROM propiedades WHERE id = contacto ORDER BY alta DESC