php class to manage json file in sql database