QComboBox.curfrentText() not working - i always get TypeError: execute() argument 1 must be str, not tuple

QComboBox.curfrentText() not working - i always get TypeError: execute() argument 1 must be str, not tuple

我的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()))

我收到 TypeError: execute() argument 1 must be str, not tuple

提前致谢...

您将 execute() sqlstr 作为参数,尝试 execute(*sqlstr) 将元组解压为不同的参数。