You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 14 SELECT Upper(`cadastrogeral`.`nome`) AS `nome`, Upper(`cadastrogeral`.`nomecracha`) AS `nomecracha`, `cadastrogeral`.`cpf`, `cadastrogeral`.`cep`, `cadastrogeral`.`logradouro`, `cadastrogeral`.`numero`, `cadastrogeral`.`complemento`, `cadastrogeral`.`bairro`, `cadastrogeral`.`cidade`, `cadastrogeral`.`estado`, `cadastrogeral`.`email`, `cadastrogeral`.`telefone`, `cadastrogeral`.`celular`, `cadastrogeral`.`aniversario_dia`, `cadastrogeral`.`aniversario_mes`, `cadastrogeral`.`profissao`, `cadastrogeral`.`ddd`, `cadastrogeral`.`dddcel`, `cadastrogeral`.`premiumcard`,`cadastrogeral`.`pais` FROM `cadastrogeral` WHERE `cadastrogeral`.`codigo` = ;