put the json to mysql functions in a class