D
D
demortall2022-02-03 19:03:07
PostgreSQL
demortall, 2022-02-03 19:03:07

Can't select postgres entry from db?

There is an entry but I can not select it with this code

def getUserByLogin(login):
        conn = connect_db()
        cur = conn.cursor()
        cur.execute("SELECT * FROM public.users WHERE login = '?' LIMIT 1", [str(login)])
        res = cur.fetchone()
        print(res)
        if not res:
            return False
        return res

and if you select everything from the table, then it is,
if you make the same request in pgadmin4, then it works

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dr. Bacon, 2022-02-03
@demortall

You don't even try to read the docs, do you? https://www.psycopg.org/docs/usage.html#basic-modu...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question