V
V
venera0602020-12-18 16:07:36
Python
venera060, 2020-12-18 16:07:36

Sqlite3 returns only part of the query, how to fix?

Everything is ok with the first question, 2-3 questions the database
selects only even answer options, and in 4-5 only the 4th one


def check_answers(self, text):
        with self.connection:
            data = self.cursor.execute('SELECT * FROM answers WHERE answers = ?', (str(text),)).fetchall()
            print(data)
            if data:
                return True
            else:
                return False


5fdca88a064a5029890950.jpeg
5fdca932e6d17781665493.jpeg5fdca952712e5385257067.jpeg

Answer the question

In order to leave comments, you need to log in

1 answer(s)
O
o5a, 2020-12-18
@venera060

It’s not entirely clear what this is about, but the request in the header has nothing to do with the id_q field.
If the specified request is actually used and the data is not selected, you may have extra spaces in the answers field (or vice versa in the question text). Screenshots can't tell.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question