-3

How I make two parametres for check database

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

Two WHERE parametres

2 Answers2

0

You can use UUID as primary key and use chat_id or user_id for Where's condition. And please explain your question breifly so we can answer better

Aditya Yadav
  • 607
  • 1
  • 5
  • 15
  • I have two meanings of status and balance. I need to find a line in the database where, status = user, and balance = some amount. And I want to compare precisely on these two parameters, so as not to make two lines: info = db.execute(f"SELECT * FROM 'storage_users' WHERE status = ? ", [status, balance]) records = info.fetchall() for row in records: balance = row[balance] print(balance) – Yurii Krestovskiy Oct 26 '21 at 09:52
  • What is the 'user' refers to? – Aditya Yadav Oct 26 '21 at 12:59
0

Just add AND between 2 WHERE conditions:

info = db.execute("SELECT * FROM 'storage_users' WHERE status = ? **AND** balance = ?", 
(status, balance))
Maksim K.
  • 156
  • 5