Guest User

Untitled

a guest
Nov 2nd, 2017
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.00 KB | None | 0 0
  1. while (True):
  2.  
  3. # Check all Streamers #
  4. tStreamers = cs.CheckStreams(debug)
  5. tStreamers.start()
  6. tStreamers.join()
  7.  
  8. # Connect to the database
  9. connect = pymysql.connect(host=constants.HOST,
  10. user=constants.USERNAME,
  11. password=constants.PASSWORD,
  12. db=constants.DATABASE,
  13. charset='utf8mb4',
  14. port=constants.PORT,
  15. cursorclass=pymysql.cursors.DictCursor)
  16. # Get Streamer Table #
  17. try:
  18.  
  19. with connect.cursor() as cursor:
  20.  
  21. # Read all Streamers #
  22. sql = "SELECT * FROM `ls_streamer` s LEFT JOIN `ls_platforms` p ON s.platform = p.id"
  23.  
  24. # Execute Query #
  25. cursor.execute(sql)
  26.  
  27. # Result to streamers Var #
  28. streamers = cursor.fetchall()
  29.  
  30. # Check if we have Streamers at all #
  31. if cursor.rowcount > 0:
  32. # DO SOMETHING HERE
Add Comment
Please, Sign In to add comment