users=cursor.execute("select users.email, users.id, count(subscriptions.game) from users, subscriptions, games where users.id=subscriptions.user and subscriptions.game=games.id and games.status='RUNNING' GROUP BY users.id")
server=smtplib.SMTP('localhost')
whileusers>0:
users=users-1
email,uid,games=cursor.fetchone()
c2=db.cursor()
t=c2.execute("select sum(balance) from transactions where user="+str(int(uid)))