Tying to get a integer from a sqlite database so I can do a calculation, but I keep having issues when trying to do the math
I understand that grabbing from the database returns a tuple, but I'm not sure how to get just the int out from that tuple, or if there is a way to just return a int
(Thanks for all your help!)
xp_update = 'UPDATE xpdata SET xp = ? WHERE user_id = ? AND guild_id = ?'
val = (xp_inc, user_id, guild_id)
cursor.execute(xp_update, val)
lvl_grab = cursor.execute('SELECT level FROM xpdata WHERE(user_id=? AND guild_id=?)', ('user_id', 'guild_id'))
xp_grab = cursor.execute('SELECT xp FROM xpdata WHERE(user_id=? AND guild_id=?)', ('user_id', 'guild_id'))
lvl_start = lvl_grab
lvl_end = int(((xp_grab+xp_inc)//42) ** 0.55)
Aucun commentaire:
Enregistrer un commentaire