Populating data to a static XFA form




I have a requirement to populate data to a XFA pdf form from a html page or from a database. I am not sure on how this can be done. Can you please tell me whether this is possible or not ? My use case - I am building a PHP application where in user submits the input to questionnaire (html form) and store the data in database. I want to populate that on statis XFA pdf form either by first converting pdf to html and then populating data to pdf form while priniting the form or connect to a database to populate pdf form. Appreciate any help and your inputs.