Erro sintax em UPDATE ?
Bom dia, tenho o seguinte erro:
Ocorreu um erro ao tentar executar esta ação, foi gerado um LOG , tente novamente mais tarde.exception 'PDOException' with message 'SQLSTATE[42000]: Syntax error or access violation: 1064 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 'WHERE 'idPaciente'='1'' at line 12'
Ao tentar executar este UPDATE:
$qUpdate = "UPDATE paciente SET cpf=:cpf,
dataNascimento=:dataNascimento,
sexo=:sexo,
telFixo=:telFixo,
celular=:celular,
profissao=:profissao,
estadoCivil=:estadoCivil,
nacionalidade=:nacionalidade,
dataCadastro=:dataCadastro,
emailConfirmado=:emailConfirmado,
cadastroLiberado=:cadastroLiberado,
WHERE idPaciente=:idPaciente";
$qUP = $instanciaCon->prepare($qUpdate);
$qUP->bindParam(':cpf', str_ireplace(".", "",$paciente->getCpf()));
$qUP->bindParam(':dataNascimento', $this->gravaData ($paciente->getDataNascimento()));
$qUP->bindParam(':sexo', $paciente->getSexo());
$qUP->bindParam(':telFixo', $paciente->getTelFixo());
$qUP->bindParam(':celular', $paciente->getCelular());
$qUP->bindParam(':profissao', $paciente->getProfissao());
$qUP->bindParam(':estadoCivil', $paciente->getEstadoCivilPaciente());
$qUP->bindParam(':nacionalidade', $paciente->getNacionalidadePaciente());
$qUP->bindParam(':dataCadastro', $paciente->getDataCadastro());
$qUP->bindParam(':emailConfirmado', $paciente->getEmailConfirmado());
$qUP->bindParam(':cadastroLiberado', $paciente->getCadastroLiberado());
$id = $idPcte['idPaciente'];
$qUP->bindParam(':idPaciente', $id);
$sucesso = $qUP->execute();
Onde esta esse erro ?
Discussão (2)
Carregando comentários...