I am creating a game and stuck at this and can't figure it out. I am storing all player information in a MYSQL database.
PLAYER|LOCATION|RESOURCEA|RESOURCEB|B1Buildings|B2Buildings
How can I update/increment RESOURCEA as a function of # in B1Buildings in a loop for all players as a SQL function given that different players may have different number of B1Buildings?
ie. B1Buildings = 2, B1Rate=2x per ServerLoop, ResourceA =ResourceA+b1Rate*b1building