Jump to content

help with radio buttons in php and mysql


orbitter

Recommended Posts

??? hi there, i was just wondering if it is possible to store a for example a question into a mysql database which consists of multiple answers using radio buttons, and then to output these questions using php. then the answer that is selected is stored in another table.

 

i am unsure whether the structure of my tables should be something like this:

 

Table 1

column 1: id

column 2: question

column 3: radiobuttons

 

table 2:

column 1 : id

column 2: answers

 

i am also unsure as to how the php code should be like.

any help would be appreciated,

 

thank you

Link to comment
Share on other sites

For the database, a basic example of what I'd go with is something like this:

 

question

id, title

 

option

id, question, title

 

answer

id, session, question, option

 

The PHP shouldn't be too difficult to figure out yourself based on the tables above, but if you do struggle, come back and show us your attempt and we'll help you get it working.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.