topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Tuesday March 19, 2024, 5:00 am
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Author Topic: multi answer multi choice database  (Read 4907 times)

h0meopathic

  • Participant
  • Joined in 2007
  • *
  • default avatar
  • Posts: 24
    • View Profile
    • Donate to Member
multi answer multi choice database
« on: March 24, 2009, 07:51 PM »
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?
« Last Edit: March 24, 2009, 07:56 PM by h0meopathic »

Deozaan

  • Charter Member
  • Joined in 2006
  • ***
  • Points: 1
  • Posts: 9,746
    • View Profile
    • Read more about this member.
    • Donate to Member
Re: multi answer multi choice database
« Reply #1 on: March 25, 2009, 11:14 PM »
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

  • Participant
  • Joined in 2007
  • *
  • default avatar
  • Posts: 24
    • View Profile
    • Donate to Member
Re: multi answer multi choice database
« Reply #2 on: March 26, 2009, 07:52 AM »
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

  • Charter Member
  • Joined in 2006
  • ***
  • Points: 1
  • Posts: 9,746
    • View Profile
    • Read more about this member.
    • Donate to Member
Re: multi answer multi choice database
« Reply #3 on: March 26, 2009, 12:13 PM »
Will the response table take two answers?

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.