Answer the question
In order to leave comments, you need to log in
How to insert variable into sqlite3 Python string?
I have a realtime variable - this is the current time, I need the realtime variable to be inserted into the table! here is the script line
cur.execute('INSERT INTO images (id, image_src) VALUES(NULL, 'realtime')')
when I compile it, the word realtime is simply written into the line, and I need the variable to fit
Answer the question
In order to leave comments, you need to log in
cur.execute("INSERT INTO images (id, image_src) VALUES(NULL, ?)", realtime)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question