PHP Developers Network
http://forums.devnetwork.net/

Best method for saving online form -> MySQL for output 2 PDF
http://forums.devnetwork.net/viewtopic.php?f=19&t=143222
Page 1 of 1

Author:  diseman [ Mon Dec 19, 2016 9:29 am ]
Post subject:  Best method for saving online form -> MySQL for output 2 PDF

Hi guys,

Never done anything like this, so wondering how you would go about doing it.

Imagine a document that has three check boxes (Yes, No, Maybe) and one of them must be marked with an 'X' when printed and handed to some fictional office.

Now online, I would prefer to code a single drop-down menu with the three options that saves the answer to my db.

However, I'm not sure how I would get the saved data to be placed, in the proper checkbox, on the outputted form when I create a PDF.

Would you save the data to one db field or would you create three separate db fields; one for each possible answer? This way, you could put the output code in each position on the form and then only one of them would appear?

Sorry for this being such an ambiguous write-up. Bottom line, would you save all three possible answers to one db field or would you create three db fields; one for YES, one for NO, and one for MAYBE?

I'll figure out how to do it later, I just want to know the best way to store the data to make it easier to get on a printed document/pdf later.

Thank you!

Author:  Celauran [ Mon Dec 19, 2016 10:11 am ]
Post subject:  Re: Best method for saving online form -> MySQL for output 2

I'd use a single column with perhaps an ENUM for the possible values. Tinyint could also work but is a little less readable and requires translation in the code.

Page 1 of 1 All times are UTC - 5 hours
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/