[FIXED] Finding values in the database

Issue

How can I find a value in a database by two parameters:

info = db.execute (
    f "SELECT * FROM 'storage_users' WHERE status =?, Type =?", [status, Type]
)

Solution

I recommend you use some sort of ORM like peewee or sqlalchemy for interacting with databases in your program because it makes interaction with databases a lot easier.

And for answering to your question, i think you try something like below :

f "SELECT * FROM 'storage_users' WHERE status ='{status}', Type ='{Type}'"


Answered By - Iman Hosseini Pour
Answer Checked By - Katrina (sql.easybugfix Volunteer)

Related Posts

Post a Comment