D
D
dmitriyprog2018-01-14 10:58:32
Python
dmitriyprog, 2018-01-14 10:58:32

Why does sqlite3 + python error occur?

self.cur.execute(self.cur.execute('UPDATE users SET firstname='+ message.text + ' WHERE id=' + str(message.chat.id)))
sqlite3.OperationalError: near "sdfG": syntax error

The function itself
def set_name(self, message):
    self.cur.execute(self.cur.execute('UPDATE users SET firstname='+ message.text + ' WHERE id=' + str(message.chat.id)))
    self.con.commit()
    return

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dimonchik, 2018-01-14
@dmitriyprog

he says to use placeholders
and neighing over
id=' + str(

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question