G
G
gadzhi152016-04-11 13:22:08
Python
gadzhi15, 2016-04-11 13:22:08

Find row number in sqllite database with desired field value in Python?

I have a table. It has two fields: ID and TOKEN. There is some string variable. I need to find the value of a variable in the ID column. If such a value exists, then read the TOKEN value from the table in the same row. I posted this code in Python, but I don’t know how to get the row number (rowid) and continue to count TOKEN.

base = sqlite3.connect("clients.db")
c = base.cursor()
a = "666"
sql_app = c.execute('SELECT ID FROM Client where ID = ?', (a, ))
sql_app = c.fetchone()

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
igor, 2016-04-11
@gadzhi15

In the id select to token replace

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question