Advertisement
Guest User

Untitled

a guest
Sep 6th, 2018
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. class Update_bd_three_hundred:
  2. connection = pymysql.connect(host="localhost",
  3. user="root",
  4. password="Pr0st1_Mn6Pred6t'cia",
  5. db="users_db")
  6.  
  7. def verification_id_three_hundred(self):
  8. with self.connection:
  9. cursor = self.connection.cursor()
  10. cursor.execute("SELECT user_id FROM three_hundred")
  11. return [x[0] for x in cursor.fetchall()]
  12.  
  13. def update_bd_for_user_id_three_hundred(self, user_id):
  14. with self.connection:
  15. cursor = self.connection.cursor()
  16. if user_id not in self.verification_id_three_hundred():
  17. cursor.execute("INSERT INTO three_hundred VALUES(%s,%s,%s)", (user_id, 'Нет', 'нет'))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement