Your issue here is that PlayerName and CharacterName are being used as a primary index/key.
However these two things are not unique - in fact, I could create as many characters as I want with the same name, and they would in effect share database variables with eachother.
In order to give each character a unique ID you need to find something that identifies character creation.
Eg: When a character logs in with a specific item : it means they have been logged in before, and are not just out of character creation.
If they log in and have no item - then they are brand new.
If they are brand new - spawn in a 1x1 item into their inventory, and give it a unique ID.
Either an auto-incrementing number from the database, or consider UnixTimestamp
Store that number on the item as a local var.
Ensure that the item is non-droppable.
Then on client login - check for existance of that item - if it is present, copy the player ID to the character.
Get/SetLocalInt etc
If it is not present - do as I mentioned above, about creating the item.
This way - when it comes to setting / getting persistent variables - you use the player ID as the unique identifier, instead of their PlayerName and CharacterName.