He doesn't found user in sql

Question:

in the code I entered to select the user_id if it will be, and to output True – if it is, or False – if there is nothing, but in the database after I added this user, it cannot be found by SELECT and as return always enter False

def user_exists(self, user_id):
        #ceck exist user or not in table
        result = self.cur.execute("SELECT 'user_id' FROM 'users' WHERE 'user_id' == ? ",(user_id,))
        print(result.fetchone())
        return bool(len(result.fetchall()))

this is the cod in SQL table

CREATE TABLE users (
    id      INTEGER PRIMARY KEY AUTOINCREMENT,
    user_id INTEGER UNIQUE
                    NOT NULL,
    regim   INTEGER NOT NULL,
    Status  INTEGER,
    datereg INTEGER DEFAULT ( (DATETIME('now') ) ) 
);

enter image description here

enter image description here

enter image description here

Asked By: SiriyiuS

||

Answers:

SELECT user_id FROM users WHERE user_id = "username etc"
Answered By: 0x27752357
Categories: questions Tags: ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.