0
you know what that mistake means?
Error:
sqlite3.OperationalError: near “ ”: syntax error
Code:
def alterturma(self):
bancoturmas = Bancoturmas()
#try:
c = bancoturmas.conexao.cursor()
c.execute("update turmas set codigoturma = '" + self.codigoturma + "', periodo= '" + self.periodo + "', turmacodigodisciplina = '" + self.turmacodigodisciplina + "', turmacpfprofessor = '" + self.turmacpfprofessor + "', lista_cpf_alunos = '" + self.lista_cpf_alunos + "' where idturma = " + self.idturma)
bancoturmas.conexao.commit()
c.close()
return "Turma atualizada com sucesso!"
#except:
#return "Ocorreu um erro na alteração da turma"
In which line is making the mistake?
– Tuxpilgrim
In the
where idturma
Missing close single quote'
– Tuxpilgrim
here: c.execute("update classrooms set codigoturma = '" + self.codigoturma + "', periodo= '" + self.periodo + "', turmacodigodisciplina = '" + self.turmacodigodisciplina + "', turmacpfprofessor = '" + self.turmacpfprofessor + "', list_cpf_students = '" + self.list_cpf_students + "' Where idturma = " + self.idturma)
– Marcela Portela
Try to see if that’s what I said in my last comment.
– Tuxpilgrim
All right. I’ll look, thank you !!
– Marcela Portela
c.execute("update classes set codigoturma = '" + self.codigoturma + "', periodo= '" + self.periodo + "', turmacodigodisciplina = '" + self.turmacodigodisciplina + "', turmacpfprofessor = '" + self.turmacpfprofessor + "', list_cpf_students = '" + self.list_cpf_students + "' Where idturma = '" + self.idturma) sqlite3.Operationalerror: unrecognized token: "'"
– Marcela Portela
gave this error now.... : ( is hard.... self.c.execute("" Attributeerror: 'Class' Object has no attribute 'c'
– Marcela Portela
your reply gave this error there :( .
– Marcela Portela