When I execute the similar code in DB Browser everything works as it should.
However, in Python it produces an error -> sqlite3.OperationalError: no such column: True
What is the problem?

now = datetime.datetime.now() now_date = (" '" + str(now.day) + ':' + str(now.month) + ':' + str(now.year) + "' ") users_db.execute("UPDATE members SET paid = False, date_of_removal =" + str(now_date) + "WHERE (days_left = 0 AND paid = True)") 
  • What type of field is paid ? - Sergey Gornostaev
  • paid = Text, date_of_removal = Text, days_left = int - Alex
  • 2
    Then SET paid = 'False' and AND paid = 'True' - Sergey Gornostaev
  • one
    Use parameterized queries. - Alexander Petrov

2 answers 2

In sqlite3 there is no boolean data type. Instead, integer 0 or 1 is used.

Therefore, paid = True is an invalid construction if you do not have the True field.

    Sergey Gornostaev suggested the correct version in the comments. Thank.

    SET paid = 'False' and AND paid = 'True'