Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import mysql.connector
- type = 'nametag' #item type. hat, mask, playerskin, etc.
- sql = mysql.connector.connect(user='storedb_username', password='PASSWORDFORSQLHERE',
- host='100.100.100.100',
- database='store_database_name')
- cursor = sql.cursor()
- query = ("SELECT * FROM store_items where type = '") + type + ("'")
- print(query)
- cursor.execute(query)
- for x in cursor:
- query = ("UPDATE store_players SET credits = credits + " + str(x[6]) + " where ID = " + str(x[1]))
- print(query)
- cursor.close()
- sql.close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement