Extract some SQL generation to a function. Add an update method.
Add player saving.