ATTENTION: You are viewing a page formatted for mobile devices; to view the full web page, click HERE.

Other Software > Developer's Corner

multi answer multi choice database

(1/1)

h0meopathic:
I'm making a survey and I have to be able to allow the surveyee to check more than one option from the multiple choice answer. I've made a single answer multiple choice answer php page behind a database, but I'm not quite sure about the multi choice option.

I'm sure I can make the php part work, but i'm not sure how I'd get both answers in the database in a neat fashion.

Any thoughts?

Deozaan:
What's wrong with checkboxes?

Or just store the different choices as booleans in the database, and mark them as 0 if they're not chosen and 1 if they are.

h0meopathic:
I just don't know how to set it up in the database.

I have a table for the questions, possible answers, and the responses.

Will the response table take two answers?

Deozaan:
Will the response table take two answers?
-h0meopathic (March 26, 2009, 07:52 AM)
--- End quote ---

That depends on how you set it up in the database.

Like I said, on the PHP page, make the multi-answer questions check boxes instead of radio buttons and then in your database put a 1 for the choices that were selected and a 0 for the ones that aren't selected.

Navigation

[0] Message Index

Go to full version