sergioas 0 Denunciar post Postado Setembro 23, 2015 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 ? Compartilhar este post Link para o post Compartilhar em outros sites
Beraldo 864 Denunciar post Postado Setembro 23, 2015 Há uma vírgula antes do WHERE Retire a vírgula desta linha: cadastroLiberado=:cadastroLiberado, Compartilhar este post Link para o post Compartilhar em outros sites
sergioas 0 Denunciar post Postado Setembro 23, 2015 Ok, era isso mesmo, mais uma vez, Obrigado. Compartilhar este post Link para o post Compartilhar em outros sites