F
F
Fedor2020-10-28 08:10:48
Python
Fedor, 2020-10-28 08:10:48

How to display value in sqlite3?

how can i find all rows in db where user_id = msg.chat.id.

Code below

user_id = msg.chat.id.
#тут коннект к бд
cur.execute("SELECT balance FROM orders WHERE user_id={user_id};")#пробовал так,дает ошибку sqlite3.OperationalError: unrecognized token: "{

I also wanted to ask, will it display the number simply or the number and all sorts of brackets?
thanks in advance

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Gornostaev, 2020-10-28
@srgvac

Once again I will give you a link to the documentation , where there is even an example.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question