insertFigureData function

Insert figure data directly to the database