S
S
s1veme2020-09-05 16:17:44
Python
s1veme, 2020-09-05 16:17:44

How to check if such USERNAME exists in sqlite3?

There is a table format:

"""CREATE TABLE IF NOT EXISTS users(
    id_records INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
    id_chat INT, 
    id_user INT,
    username TEXT,
    having_ban INT DEFAULT 0 NOT NULL, 
    having_kick INT DEFAULT 0 NOT NULL);"""


User enters username, how to check if such username exists in table? If there is, do something.
And how, having only one data, to get others? For example, I only have id_user - how can I get username and the rest from this data?


Thanks in advance!

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question