There is an error on the SQL command.

SQL:
SELECT *, IF(CODIGOW<>'',CODIGOW,CODIGO) AS CODIGOW, DORMITORIO as DORM, VAGAS as VAGA, AREA_PRIVATIVA as AREAP, AREA_TOTAL as AREAT, AREA_CONSTRUIDA as AREAC FROM fbz_imoveis imo WHERE VER_WEB='Sim' AND (STATUS = 'VENDA' OR STATUS = 'ALUGUEL' OR STATUS = 'VENDA E ALUGUEL') AND imo.CODIGO=17988 /*ORDEM*/ /*LIMIT*/

Error:
MySQL server has gone away