Answer the question
In order to leave comments, you need to log in
How to display a specific row from a sqlite3 database?
Good day! The question is that I need to display a certain row from the entire database, and not through WHERE. How to make it so that, for example, the line that he just filled out is returned to the user? Or, at least, only id? Code snippet:
def registration():
NAME = input('Как тебя зовут?(Например, Иван): ')
SURNAME = input('Введи фамилию (Например, Иванов): ')
PATRONYMIC = input('Введи отчество (Например, Иванович: ')
CLASS = input('В каком классе ты учишься? (Например, 6А) : ')
cursor.execute('INSERT INTO ids (name, surname, patronymic, class) VALUES (NAME, SURNAME, PATRONYMIC, CLASS)')
def take(cursor):
book = input('Какую книгу ты хочешь взять? (введи только название): ')
user_id = ('Пожалуйста, введи свой id: ')
cursor.execute('')
Answer the question
In order to leave comments, you need to log in
при этом не через WHERE
WHERE id = currentId
Actually only through WHERE.
cursor.execute("SELECT * FROM table WHERE name = %s AND surname = %s", (var1, var2))
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question