'QComboBox.curfrentText() not working - i always get TypeError: execute() argument 1 must be str, not tuple
What's wrong with my sqlstr
def clicker(self):
cursor = self.conn.cursor()
sqlstr = ('''
SELECT t1.column3, t2.column2, t2.column3, t2.column4
FROM t1
INNER JOIN t2 ON t1.id_number = t2.id_number
WHERE t1.column3 = ? AND t2.column2 = ?''',
(self.qcombobox1.currentText()), (self.qcombobox2.currentText()))
I am getting TypeError: execute() argument 1 must be str, not tuple
Thanks in advance...
Solution 1:[1]
You give execute() sqlstr as an argument, try execute(*sqlstr) instead to unpack the tuple as different arguments.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Bharel |
