PHP Developers Network

A community of PHP developers offering assistance, advice, discussion, and friendship.
 
Loading
It is currently Fri Dec 15, 2017 12:50 pm

All times are UTC - 5 hours




Post new topic Reply to topic  [ 2 posts ] 
Author Message
PostPosted: Mon Dec 19, 2016 9:29 am 
Offline
Forum Contributor
User avatar

Joined: Mon Jul 26, 2010 1:30 pm
Posts: 174
Location: Florida
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!


Top
 Profile  
 
PostPosted: Mon Dec 19, 2016 10:11 am 
Offline
Moderator
User avatar

Joined: Tue Nov 09, 2010 3:39 pm
Posts: 6404
Location: Montreal, Canada
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.

_________________
Supported PHP versions No longer supported versions


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 7 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group