X
X
xxxfdd2020-11-20 19:28:50
Python
xxxfdd, 2020-11-20 19:28:50

What is wrong with the replacement?

TypeError: can only concatenate str (not "int") to str

import sqlite3
a = 1
con = sqlite3.connect('telebot.sqlite')
cur = con.cursor()
jo = 'Юля'
mas = []
mas.append(jo)
g = 1
cur.execute("UPDATE telebot228 SET name= '" + jo + "' WHERE id =" + g)

con.commit()
con.close()


5fb7eea6f4190557034490.png

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Karbivnichy, 2020-11-20
@xxxfdd

cur.execute("UPDATE telebot228 SET name=? WHERE id =?",(jo,g))
sqlite module - Working with the database
telebot 228
And Julia is your client, or a pawnbroker?
I hope you are not a dealer, I do not want the cops to take me for complicity (

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question