What would you do in this situation dealing with saving data to a MySQL database?

You can’t return data like that.

Instead of doing it like this ->
[LUA]local value = ply:GetPData( “key”, 0 )
print( value )
> nil[/LUA]

you have to do it like this
[LUA]
local function test( ply )
local value

ply:GetPData( "key", 0, function( data )
	value = data
	-- ply:ChatPrint( value )
	-- do whatever you want with the data
end )

end
[/LUA]

Funny thing is I did originally have it that way. I actually typed it that way about 1 or 2 post above the one I had posted recently.

Wait why did he tell me I was wrong then…

In my head it was working , but the user-messages were not sending the right data.

Ok, this is EXTREMELY STRANGE.

It is finally working and the second I upload it to the server it starts spewing out incorrect values.

Example:

xp = 100
kill someone
xp = 50
kill someone
xp=0