Hellman228

python in bd

Jun 19th, 2020
1,363
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.35 KB | None | 0 0
  1. try:
  2.     conn = sqlite3.connect("db.sqlite")
  3.     cursor = conn.cursor()
  4.  
  5.     category = ','.join(categories)
  6.                
  7.     sql = """
  8.     UPDATE Users
  9.     SET Categories = 'None{}'
  10.     WHERE Categories = '{}'
  11.     """.format(call.from_user.id, category)
  12.  
  13.     cursor.execute(sql)
  14.     conn.commit()
  15.     except Error as e:
  16.         print(e)
  17.     finally:
  18.         conn.close()
Advertisement
Add Comment
Please, Sign In to add comment