V
V
⚡Valery⚡2015-09-29 17:52:07
MySQL
⚡Valery⚡, 2015-09-29 17:52:07

How to make sqlite query?

good evening everyone please tell me how

a = int(input("ID: ")) , str(input("TEXT: ")), int(input("PRISE: "))

put
cur.execute("INSERT INTO Cars VALUES" + a)
----------
cur.execute("INSERT INTO Cars VALUES" + a)
TypeError: Can't convert 'tuple' object to str implicitly

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Dimonchik, 2015-09-29
@dimonchik2013

convert the tuple to a string,
something like
stroka = ','.join(a)

S
Sergey Pankov, 2015-09-30
@trapwalker

It's more correct like this:
This, in contrast to forming the query as a string, will save you from SQL injections.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question