I need to pull a value from a line into the database, and if the value in this line is male, then output the text to the terminal, I try to do it like this
def get_genderr (self, chat_id, gender): with self.connection: self.cursor.execute ("SELECT * FROM` users` WHERE `chat_id`, 'gender'= (?,?)", (chat_id, gender)). fetchmany (1) # View gender if gender== 'male': print ('test')
I am writing in python sql3 database
- python : How to implement validation of sql string for input data?
- How can I speed up looking up data in a Python dictionary?
- python : How to pull rows from database excluding some of them?
- python : Why is the select query only returning column names?
- python : I want to return JSON with a tree structure from SQL result
- Only the first character is passed to a SQL query from Python
- python : Error reading data from SQL
- Python parser does not work (sqlite3.InterfaceError)
- python : Can't pull text from the database
- python : error TypeError: execute expected at most 2 arguments, got 4