Advertisement
Guest User

Untitled

a guest
Oct 6th, 2017
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. import mysql.connector
  2.  
  3. type = 'nametag' #item type. hat, mask, playerskin, etc.
  4.  
  5. sql = mysql.connector.connect(user='storedb_username', password='PASSWORDFORSQLHERE',
  6. host='100.100.100.100',
  7. database='store_database_name')
  8. cursor = sql.cursor()
  9.  
  10. query = ("SELECT * FROM store_items where type = '") + type + ("'")
  11. print(query)
  12. cursor.execute(query)
  13.  
  14. for x in cursor:
  15. query = ("UPDATE store_players SET credits = credits + " + str(x[6]) + " where ID = " + str(x[1]))
  16. print(query)
  17.  
  18. cursor.close()
  19. sql.close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement